connectNullData: Boolean

By default, a line breaks wherever a null dataPoint (y = null) is present. You can change this behaviour to draw a line between adjacent non-null dataPoints by setting connectNullData to true.

Default: False
Options: True, False

var  chart =  new  CanvasJS.Chart("container",
   connectNullData: true,

Try it Yourself by Editing the Code below.

  Also See:    

If you have any questions, please feel free to ask in our forums.Ask Question

Comments 5

  1. I really like this feature and will certainly be using it, however when I change to type: “spline” the nice curve disappears and only an ugly straight line connects the dots. The other one I tried was “column” and that doesn’t attempt to create a column with a dotted outline at an estimated height between the 40 and the 60 as I had expected.

    I realize that connectNullData:true is only in CanvasJS Charts 1.8.1 Beta 1 at this stage but what plans do you have to cater for missing data in those cases?

    • Lloyd,

      connectNullData Behavior in Spline (straight line) was intentional in order to show that there is no data in that range. But we’ll reconsider it again before going GA.

      When it comes to column we don’t have plans to implement column with dotted outline for null data at the moment. But if required, you can emulate the same by adding some transparency (using color property – rgba) to a column at that point.

      We are considering connectNullData for area charts (area, rangeArea, etc) as well. But we are still not sure about it.

    • Lloyd,

      We released CanvasJS v1.8.1 Beta 2 with connectNull property for all area charts. Do have a look and let us know your feedback..

  2. Pingback: CanvasJS Charts 1.8.1 Beta 2 Released - CanvasJS

  3. Pingback: CanvasJS Chart 1.8.1 goes GA - CanvasJS

If you have any questions, please feel free to ask in our forums. Ask Question