👍:0
👍:0
Assuming you’re talking about localizing dates, you need to first make sure the chart displays dates that can be parsed by the JavaScript’s toLocaleDateString
function.
e.g. options.scales.xAxes[0].time.displayFormats.day = 'h:mm:ss a';
The list of possible formats is https://www.chartjs.org/docs/2.9.4/axes/cartesian/time.html
Then, again, in your options
json options.scales.xAxes[0].ticks
, set a callback to your date value where you can localize it like shown below.
callback: function (value) {
return new Date(value).toLocaleDateString('ja-JP', {
dateStyle: 'long',
timeStyle: 'long'
});
}
👍:-2
Well, chartjs has nothing to do with localization; and no, it doesn’t.
They even have no support for flipping labels etc. But you shouldn’t have any problems unless you need to display rtl charts.