0👍
To use both datasets as separate axes, you just need to map your data like this :
data : [
{x:3598.599878, y:0.01},
{x:3598.595369, y:0.03},
{x:3598.580042, y:0.06},
...
]
Then in your options, make sure your X axis type is linear
:
options : {
scales:
{x:
{ type:'linear', ...}
}
}
This is because X axis type is category
by default, and both your datasets are numeric, so after mapping, you will end up with only 1 dataset, and you can set the chart type to be line
, bar
or scatter
.
- Chartjs-Thingsboard – Custom timeseries widget injected with Chart.js library
- Chartjs-How can i move a point through both x-axis and y-axis while the curve is not changed in a chart.js line graph?
Source:stackexchange.com