mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
Updated how datasets are loaded, preventing chart redraw.
This commit is contained in:
parent
b1856c7eb3
commit
e33a8e054b
@ -45,7 +45,7 @@ export default function BarChart({
|
||||
|
||||
switch (unit) {
|
||||
case 'minute':
|
||||
return dateFormat(d, 'H:mm', locale);
|
||||
return dateFormat(d, 'h:mm', locale);
|
||||
case 'hour':
|
||||
return dateFormat(d, 'p', locale);
|
||||
case 'day':
|
||||
@ -177,15 +177,16 @@ export default function BarChart({
|
||||
const updateChart = () => {
|
||||
setTooltip(null);
|
||||
|
||||
datasets.forEach((dataset, index) => {
|
||||
chart.current.data.datasets[index].data = dataset.data;
|
||||
chart.current.data.datasets[index].label = dataset.label;
|
||||
});
|
||||
|
||||
chart.current.options = getOptions();
|
||||
|
||||
if (datasets.length) {
|
||||
chart.current.data.datasets = datasets;
|
||||
}
|
||||
onUpdate(chart.current);
|
||||
|
||||
chart.current.update();
|
||||
|
||||
onUpdate(chart.current);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user