Chart labels should update when changing locale.

This commit is contained in:
Mike Cao 2020-09-07 21:32:45 -07:00
parent ccca5d2d99
commit 7164977f9f
2 changed files with 9 additions and 1 deletions

View File

@ -151,7 +151,7 @@ export default function BarChart({
updateChart();
}
}
}, [datasets, unit, animationDuration]);
}, [datasets, unit, animationDuration, locale]);
return (
<>

View File

@ -12,7 +12,15 @@ export default function PageviewsChart({ websiteId, data, unit, records, classNa
} = chart;
datasets[0].data = data.uniques;
datasets[0].label = intl.formatMessage({
id: 'metrics.unique-visitors',
defaultMessage: 'Unique visitors',
});
datasets[1].data = data.pageviews;
datasets[1].label = intl.formatMessage({
id: 'metrics.page-views',
defaultMessage: 'Page views',
});
chart.update();
};