PluginProbe
ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce / 1.6.7
ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce v1.6.7
1.17.9 1.17.8 1.17.7 1.17.6 1.17.5 1.17.4 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.3.0 1.3.1 1.3.11 1.3.12 1.3.13 1.3.14 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 All 143 releases
erp / modules / accounting / assets / js / status_chart.js

status_chart.js in ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce 1.6.7, at modules/accounting/assets/js/status_chart.js

58 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var colors = ['#208DF8', '#E9485E', '#FF9900', '#2DCB67'],
2 labels = ['Paid', 'Overdue', 'Partial', 'Draft'],
3 data = [2, 1, 2, 3],
4 bgColor = colors,
5 dataChart = {
6 labels: labels,
7 datasets: [{
8 data: data,
9 backgroundColor: bgColor
10 }]
11 },
12 config = {
13 type: 'doughnut',
14 data: dataChart,
15 options: {
16 maintainAspectRatio: true,
17 cutoutPercentage: 45,
18 legend: {
19 display: false
20 },
21 // generate custom labels
22 legendCallback: function(chart) {
23 var text = [];
24 text.push('<ul class="chart-labels-list">');
25 if (chart.data.datasets.length) {
26 for (var i = 0; i < chart.data.datasets[0].data.length; ++i) {
27 text.push('<li><div class="label-icon-wrapper">\
28 <span class="chart-label-icon" style="background-color:' + chart.data.datasets[0].backgroundColor[i] + '"></span>\
29 </div><div class="chart-label-values">');
30 if (chart.data.datasets[0].data[i]) {
31 text.push('<span class="chart-value">' + chart.data.datasets[0].data[i] + '</span>');
32 }
33 if (chart.data.labels[i]) {
34 text.push('<span class="chart-label"> ' + chart.data.labels[i] + '</span>');
35 }
36 text.push('</div></li>');
37 }
38 }
39 text.push('</ul>');
40
41 return text.join("");
42 },
43 }
44 };
45
46 setTimeout(function() {
47 var status_chart_ctx = document.getElementById('status_chart');
48
49 if ( status_chart_ctx !== null ) {
50 status_chart_ctx = status_chart_ctx.getContext("2d"),
51 status_chart = new Chart(status_chart_ctx, config),
52 status_legend = status_chart.generateLegend(),
53 status_legendHolder = document.getElementById("status_legend");
54 status_legendHolder.innerHTML = status_legend
55 }
56
57 }, 1000);
58