cytadela8
cytadela8•13mo ago

Chartjs options not working

Hi, do chartjs options actually work? I'm trying to scale the x axis properly (I have dates on the x axis). Specifying the "options" seems to have no effect. I'm trying to use following options:
{
"scales": {
"x": {
"type": "time",
"time": {
"unit": "second",
"displayFormats": {
"second": "YYYY-MM-DD HH:mm:ss"
}
},
"title": {
"display": true,
"text": "Time"
}
},
"y": {
"title": {
"display": true,
"text": "Value"
}
}
}
}
{
"scales": {
"x": {
"type": "time",
"time": {
"unit": "second",
"displayFormats": {
"second": "YYYY-MM-DD HH:mm:ss"
}
},
"title": {
"display": true,
"text": "Time"
}
},
"y": {
"title": {
"display": true,
"text": "Value"
}
}
}
}
4 Replies
rubenf
rubenf•13mo ago
@Faton ^
cytadela8
cytadela8OP•13mo ago
So I kind of found a way to solve this by moving to Plotly. Plotly properly handles dates by default 🙃
Faton
Faton•13mo ago
Thanks for the feedback! There was a bug for scales option in particular. Other options works correctly. I will make a fix and ping you when it's deployed
cytadela8
cytadela8OP•13mo ago
Thanks!!! 😄

Did you find this page helpful?