Home forums Using CanvasJS Leave blanks for missing data (not null, but missing)

This topic contains 2 replies, has 3 voices, and was last updated by  Vishwas R 1 week, 2 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #9388



    First off, thank you for this wonderful tool! I am really impressed with it and it has proven very useful.

    I would like to graph a trend of my CPU temps over the course of the week. However, if my computer is off, it isn’t collecting data points. And I don’t want to just leave it on. I want to use the graph to track data during it’s natural on/off cycle of use also. However, instead of connecting the gaps, I want there to be a blank space. That will make off-periods stand out much better. There is an example in the gallery here, but it is built with an intentional “null” value added as a data point: http://canvasjs.com/docs/charts/basics-of-creating-html5-chart/date-time-axis/. I want to do the same thing, but automatically (instead of manually inserting ‘null’s) when data ‘gaps’ occur because my PC was off and wasn’t collecting data for that time. I can try to post a JSFiddle if this doesn’t make sense and just put in comments where I think the new code should go or something…

    In case it helps clarify (and apologies for the external example), I found an example of this feature at amcharts here: http://www.amcharts.com/demos/chart-with-gaps-in-data/. However, I like Canvas JS better and I’d like to stick with it. I just need to figure out how / if I can do this in Canvas JS.

    {EDIT: Had a second question about setting the line color based on the value of the data point, but I found out how to do that here: http://canvasjs.com/editor/?id=http://canvasjs.com/example/gallery/dynamic/live_column/. Still haven’t figured out the first part, however…}

    Thank you again for a great product and thank you for your time.


    • This topic was modified 1 year ago by  Boswen. Reason: Found the answer to part 2


    I’d love to know how to do this too. Be great if you could define an interval gap with so that data between two adjacent points which are separated by more than this gap would be treats as missing and just not drawn at all.


    Vishwas R


    Sorry, we don’t have this feature as of now. But with couple of lines of code you can do the same. Check this jsfiddle.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.