I am trying to use chart.js to create a multi-line time series plot. The issue is that data points for each of the lines may not have the same interval, for eg. one line can have points at an interval of 5 sec. and another line can have points at an interval of 10 sec.
Can someone suggest me how to approach this.
The above use case can more correctly understood by looking at this.
A multi-line chart is a basic line chart with one or more additional lines that represent comparison trends.
Chartjs (v2.0 onwards) has added time-series chart, samples of which could be found in the their samples folder located in their github repository This lets one plot chart against a time series in X/Y axis.
Chart.Scatter (http://dima117.github.io/Chart.Scatter/) is an addon for the Chart.js library - it is listed in the Chart.js documentation - http://www.chartjs.org/docs/#advanced-usage-community-extensions
Chart.Scatter adds a date scale to the chart options
// DATE SCALE
// String - scale type: "number" or "date"
scaleType: ...
You can see it in action on the Chart.Scatter home page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With