Revision 07949723
Von Bernd Bleßmann vor etwa 2 Jahren hinzugefügt
js/kivi.CustomerVendorTurnover.js | ||
---|---|---|
70 | 70 |
}; |
71 | 71 |
|
72 | 72 |
ns.draw_chart = function(data) { |
73 |
// Todos are most probably better done in the perl backend. |
|
74 |
// Todo: fill holes |
|
75 |
// Todo: show amount/paid in one/each bar |
|
76 |
// data = [ |
|
77 |
// {date_part: 2022, netamount: 1234.4}, |
|
78 |
// {date_part: 2022, netamount: 234.4}, |
|
79 |
// {date_part: 2021, netamount: 234.4}, |
|
80 |
// {date_part: 2021, netamount: 34.4}, |
|
81 |
// {date_part: 2020, netamount: 134.4}, |
|
82 |
// {date_part: 2018, netamount: 34.4} |
|
83 |
// ]; |
|
84 |
|
|
85 | 73 |
$(data).each(function(idx, elt) { |
86 | 74 |
elt.date_part = '' + elt.date_part; |
87 | 75 |
}); |
... | ... | |
165 | 153 |
}); |
166 | 154 |
}; |
167 | 155 |
|
168 |
ns.sample_chart = function() { |
|
169 |
const ctx = 'chart'; |
|
170 |
const myChart = new Chart(ctx, { |
|
171 |
type: 'bar', |
|
172 |
data: { |
|
173 |
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], |
|
174 |
datasets: [{ |
|
175 |
label: '# of Votes', |
|
176 |
data: [12, 19, 3, 5, 2, 3], |
|
177 |
backgroundColor: [ |
|
178 |
'rgba(255, 99, 132, 0.2)', |
|
179 |
'rgba(54, 162, 235, 0.2)', |
|
180 |
'rgba(255, 206, 86, 0.2)', |
|
181 |
'rgba(75, 192, 192, 0.2)', |
|
182 |
'rgba(153, 102, 255, 0.2)', |
|
183 |
'rgba(255, 159, 64, 0.2)' |
|
184 |
], |
|
185 |
borderColor: [ |
|
186 |
'rgba(255, 99, 132, 1)', |
|
187 |
'rgba(54, 162, 235, 1)', |
|
188 |
'rgba(255, 206, 86, 1)', |
|
189 |
'rgba(75, 192, 192, 1)', |
|
190 |
'rgba(153, 102, 255, 1)', |
|
191 |
'rgba(255, 159, 64, 1)' |
|
192 |
], |
|
193 |
borderWidth: 1 |
|
194 |
}] |
|
195 |
}, |
|
196 |
options: { |
|
197 |
scales: { |
|
198 |
y: { |
|
199 |
beginAtZero: true |
|
200 |
} |
|
201 |
} |
|
202 |
} |
|
203 |
}); |
|
204 |
}; |
|
205 |
|
|
206 | 156 |
ns.cv_tabs_init = function () { |
207 | 157 |
$("#customer_vendor_tabs").on('tabsbeforeactivate', function(event, ui){ |
208 | 158 |
if (ui.newPanel.attr('id') == 'quotations') { |
Auch abrufbar als: Unified diff
Umsatzstatistik-Chart: js: Kosmetik: alten Kommentar u. Bsp.-Chart entfernt