Methods

redraw()

Redraws the entire sparkline. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI.

  • html
  • <div id="sparkline">Sparkline</div>
  • javascript
  • /// <reference path="tsfiles/jquery.d.ts" />
    /// <reference path="tsfiles/ej.web.all.d.ts" />
    
    module SparklineComponent {
        $(function () {
            var sample = new ej.datavisualization.Sparkline($("#Sparkline"),{
            //..//   
            });
           // Redraws the Sparkline
         sample.redraw(); 
        });
    });
    }

    Events

    load

    Fires before loading the sparkline.

  • javascript
  • <script>
    
    //load event for sparkline
      $(function () {
            var sample = new ej.datavisualization.Sparkline($("#Sparkline"), {
                  load: function () {
                     //..//
                    }
                });
            });
           
    </script>

    loaded

    Fires after loaded the sparkline.

  • javascript
  • <script>
    
    //loaded event for sparkline
      $(function () {
            var sample = new ej.datavisualization.Sparkline($("#Sparkline"), {
                  loaded: function () {
                     //..//
                    }
                });
            });
           
    </script>

    tooltipInitialize

    Fires before rendering trackball tooltip. You can use this event to customize the text displayed in trackball tooltip.

  • javascript
  • <script>
    
    //tooltip initialize event for sparkline
      $(function () {
            var sample = new ej.datavisualization.Sparkline($("#Sparkline"), {
                  tooltipInitialize: function () {
                     //..//
                    }
                });
            });
           
    </script>

    seriesRendering

    Fires before rendering a series. This event is fired for each series in Sparkline.

  • javascript
  • <script>
    
    //seriesRendering event for sparkline
      $(function () {
            var sample = new ej.datavisualization.Sparkline($("#Sparkline"), {
               seriesRendering: function () {
                     //..//
                    }
                });
            });
           
    </script>

    pointRegionMouseMove

    Fires when mouse is moved over a point.

  • javascript
  • <script>
    
    //pointRegionMouseMove event for sparkline
      $(function () {
            var sample = new ej.datavisualization.Sparkline($("#Sparkline"), {
              pointRegionMouseMove: function () {
                     //..//
                    }
                });
            });
           
    </script>

    pointRegionMouseClick

    Fires on clicking a point in sparkline. You can use this event to handle clicks made on points.

  • javascript
  • <script>
    
    //pointRegionMouseClick event for sparkline
      $(function () {
            var sample = new ej.datavisualization.Sparkline($("#Sparkline"), {
               pointRegionMouseClick: function () {
                     //..//
                    }
                });
            });
           
    </script>

    sparklineMouseMove

    Fires on moving mouse over the sparkline.

  • javascript
  • <script>
    
    //mouse move event for sparkline
      $(function () {
            var sample = new ej.datavisualization.Sparkline($("#Sparkline"), {
               sparklineMouseMove: function () {
                     //..//
                    }
                });
            });
           
    </script>

    sparklineMouseLeave

    Fires on moving mouse outside the sparkline.

  • javascript
  • <script>
    
    //mouse leave event for sparkline
      $(function () {
            var sample = new ej.datavisualization.Sparkline($("#Sparkline"), {
               sparklineMouseLeave: function () {
                     //..//
                    }
                });
            });
           
    </script>