Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting points between missing data in chart.js

Tags:

I'm using chart.js and I have some missing data between multiple day entries at certain points in my chart. I've assigned these values null, but would like the chart to draw a connection line between the missing points. Here is what I have:

enter image description here

Is there a way to connect the dots in chart.js? Or perhaps someone could point me towards a chart library that can. Thanks.

like image 767
user3442612 Avatar asked Nov 24 '14 15:11

user3442612


1 Answers

New version supports skipping missing data. You can set spanGaps: true in the options. Then if you have null or NaN for missing data, it will skip it and connect to the next point.

.....
 showTooltips: true,
        options: {
             spanGaps: true,
  ......

Documentation here

like image 85
Selay Avatar answered Oct 26 '22 21:10

Selay