I am using chartjs 2.9.3
. I want to have linear scale for x axis for bar plots. It should work just like any linear scale of line plots representing negative, decimal, positive values.
I have managed to create almost similar scale here using this options.
scales: {
xAxes: [
{
type: "time",
time: {
parser: "Y",
unit: "year",
displayFormats: {
year: "Y"
}
},
}
]
},
But it is not working for decimal values, when dataset has negative x
values, it is just rounding off to integer and placing the bar at that position.
How can represent decimal values as well?
Chartjs >=3.0.0
has introduced linear scale for bar plots. But this version has some other bugs in it so I am stuck with 2.9.3 version