You can't change locale of datetime. but you can modify dateAxis
by geting rendered text and change it by adapter.
for tooltip:
dateAxis.adapter.add("getTooltipText", function(text){
return new Date(text).toLocaleDateString('fa-IR')
})
for label:
dateAxis.renderer.labels.template.adapter.add("text", function(text) {
return new Date(text).toLocaleDateString('fa-IR');
});
for label I recommend to get text from 'target.dataItem' because some times text was shorted... like: "April"
dateAxis.renderer.labels.template.adapter.add("text", function (text, target, key) {
if (text !== undefined) {
return new Date(target.dataItem.values.value.value).toLocaleDateString('fa-IR');
}
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.