Methods and Events

Methods

redraw()

This methods redraws the entire sparkline. You can call redraw() whenever you update, add or remove points from the data source or whenever you want to refresh the UI.

  • js
  • // redraw method for sparkline
    $("#container").ejSparkline("redraw");

    Events

    load

    The load event is fired before loading the sparkline.

  • js
  • $("#container").ejSparkline({
    
     //load event for sparkline
        load: function (args) {
                 //Do something
        }
        
    });

    loaded

    The loaded event is fired after loaded the sparkline.

  • js
  • $("#container").ejSparkline({
    
    //loaded event for sparkline
        loaded: function (args) {
                 //Do something
        }
        
    });

    tooltipInitialize

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

  • js
  • $("#container").ejSparkline({
    
    //ToolTip event for sparkline
        tooltipInitialize: function (args) {
                  //Do something
        }
       
    });

    seriesRendering

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

  • js
  • $("#container").ejSparkline({
    
    //seriesRendering event for sparkline
        seriesRendering: function (args) {
                  //Do something
        }
        
    });

    pointRegionMouseMove

    The pointRegionMouseMove event is fired when mouse is moved over a point.

  • js
  • $("#container").ejSparkline({
    
    //pointRegionMouseMove event for sparkline
        pointRegionMouseMove: function (args) {
                      //Do something
        }
       
    });

    pointRegionMouseClick

    The pointRegionMouseClick event is fired on clicking a point in sparkline. You can use this event to handle clicks made on points.

  • js
  • $("#container").ejSparkline({
    
    //pointRegionClick event for sparkline
        pointRegionMouseClick: function (args) {
                 //Do something
        }
        
    });

    sparklineMouseMove

    The sparklineMouseMove is fired on moving mouse over the sparkline.

  • js
  • $("#container").ejSparkline({
    
    //sparklineMouseMove event for sparkline
        sparklineMouseMove: function (args) {
                  //Do something
        }
       
    });

    sparklineMouseLeave

    The sparklineMouseLeave event is fired on moving mouse outside the sparkline.

  • js
  • $("#container").ejSparkline({
    
    //sparklineMouseLeave event for sparkline
        sparklineMouseLeave: function (args) {
                  //Do something
        }
       
    });

    Click

    The click event is fired on clicking the sparkline.

  • js
  • //Click event for sparkline
    
     $("#container").ejSparkline({
    
    
        click: function (args) {
                  //Do something
        }
       
    });

    doubleClick

    The doubleClick event is fired on double clicking the sparkline.

  • js
  • //DoubleClick event for sparkline
    
     $("#container").ejSparkline({
    
    
        doubleClick: function (args) {
                  //Do something
        }
       
    });

    rightClick

    The rightClick event is fired on right clicking the sparkline.

  • js
  • //RightClick event for sparkline
    
     $("#container").ejSparkline({
    
        rightClick: function (args) {
                  //Do something
        }
       
    });