Not drawing null values using chart.js

前端 未结 5 1689
别那么骄傲
别那么骄傲 2021-02-05 12:00

I\'m using Chart.js to draw a chart.. My dataset have some null values, Actually chart.js plot a line between points that are previous and successor of the null values in this w

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-05 12:58

    In case you still reach this page, New version supports skipping missing data. . If you want the lines to be connected by 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

提交回复
热议问题