Fix line_chart.js
This commit is contained in:
parent
123582b730
commit
90d9a80f4f
|
@ -44,8 +44,8 @@ class LineChart extends Stat {
|
||||||
labels.push(date.format("MMMM YYYY"));
|
labels.push(date.format("MMMM YYYY"));
|
||||||
});
|
});
|
||||||
|
|
||||||
while (chart.data.badges.length < data.results.length) {
|
while (chart.data.labels.length < data.results.length) {
|
||||||
chart.data.badges.push("");
|
chart.data.labels.push("");
|
||||||
}
|
}
|
||||||
|
|
||||||
chart.data.datasets.push({
|
chart.data.datasets.push({
|
||||||
|
@ -100,11 +100,11 @@ class LineChart extends Stat {
|
||||||
color = color.substr(0, 7);
|
color = color.substr(0, 7);
|
||||||
|
|
||||||
chart.data.datasets.splice(dataset_index, 1);
|
chart.data.datasets.splice(dataset_index, 1);
|
||||||
chart.data.badges.splice(dataset_index, 1);
|
chart.data.labels.splice(dataset_index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (chart.data.badges.length > max_length) {
|
while (chart.data.labels.length > max_length) {
|
||||||
chart.data.badges.pop("");
|
chart.data.labels.pop("");
|
||||||
}
|
}
|
||||||
|
|
||||||
chart.update();
|
chart.update();
|
||||||
|
|
Loading…
Reference in New Issue