Empty Points

The Data points that uses the null or undefined as value are considered as empty points. Empty data points are ignored and not plotted in the Chart. When the data is provided by using the points property, you can set the isEmpty to true to specify that the particular point is an empty point.

  • javascript
  • /// <reference path="tsfiles/jquery.d.ts" />
    /// <reference path="tsfiles/ej.web.all.d.ts" />
    
    module ChartComponent {
        $(function () {
            var chartsample = new ej.datavisualization.Chart($("#chartcontainer"), {
                   series:[ {
                         //Using empty points 
                         points: [
                                  { x: 0, y: 210 }, 
                                  { x: 1, y: null }, { x: 2, y: 150 },
                                  { x: 3, y: 180,isEmpty: true }, 
                                  { x: 4, y: 170},
                                  { x: 5, y: 200 }, 
                                  { x: 6, y: 140, isEmpty: true },
                                  { x: 7, y: 120 }, { x: 8, y: 140 } 
                              ],
                 }],
    
                // ...
           });

    EmptyPointSettings

    You can customize the empty points visibility and change its displayMode (gap, zero and average) using emptyPointSettings option.

  • javascript
  • var chartsample = new ej.datavisualization.Chart($("#chartcontainer"), {
                    
                series:[ {
                       //...
                       emptyPointSettings: {
                           // visible the empty point settings with displayMode as average
                           visible: true,
                           displayMode : "average"
                         }, 
                    }],
    
                // ...
           });

    If the visible property of emptyPointSettings is false, then the empty points has been dropped and chart will be rendered without empty points.

    Customizing Styles

    Empty points color and border can be customized using style property of emptyPointSettings.

  • javascript
  • var chartsample = new ej.datavisualization.Chart($("#chartcontainer"), {
                series:[{
                       //...
                       emptyPointSettings: {
                           visible: true,
                           //Customizing empty points styles
                           style: {
                               color: "#ffa000",
                               border:{
                                   color: "gray",
                                   width:2
                                }
                            }
                         }, 
                    }],
    
                // ...
           });