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.

  • ts
  • export class AppComponent {
    
    redraw(){
              
         this.sparkline.widget.redraw();
    
    }
    
    // Create sparkline instance
    @ViewChild('line') sparkline: EJComponents<any, any>;
    
    }

    Events

    load

    Fires before loading the sparkline.

  • ts
  • onLoad(sender){
         
         //Do something
    
    }
  • html
  • <ej-sparkline id="events" (load)="onLoad($event)">
    </ej-sparkline>

    loaded

    Fires after loaded the sparkline.

  • ts
  • onLoaded(sender){
         
         //Do something
    
    }
  • html
  • <ej-sparkline id="events" (loaded)="onLoaded($event)">
    </ej-sparkline>

    tooltipInitialize

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

  • ts
  • onTooltipInitialize(sender){
         
         //Do something
    
    }
  • html
  • <ej-sparkline id="events" (tooltipInitialize)="onTooltipInitialize($event)">
    </ej-sparkline>

    seriesRendering

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

  • ts
  • onSeriesRendering(sender){
         
         //Do something
    
    }
  • html
  • <ej-sparkline id="events" (seriesRendering)="onSeriesRendering($event)">
    </ej-sparkline>

    pointRegionMouseMove

    Fires when mouse is moved over a point.

  • ts
  • onPointRegionMouseMove(sender){
         
         //Do something
    
    }
  • html
  • <ej-sparkline id="events" (pointRegionMouseMove)="onPointRegionMouseMove($event)">
    </ej-sparkline>

    pointRegionMouseClick

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

  • ts
  • onPointRegionMouseClick(sender){
         
         //Do something
    
    }
  • html
  • <ej-sparkline id="events" (pointRegionMouseClick)="onPointRegionMouseClick($event)">
    </ej-sparkline>

    sparklineMouseMove

    Fires on moving mouse over the sparkline.

  • ts
  • onSparkLineMouseMove(sender){
         
         //Do something
    
    }
  • html
  • <ej-sparkline id="events" (sparklineMouseMove)="onSparkLineMouseMove($event)">
    </ej-sparkline>

    sparklineMouseLeave

    Fires on moving mouse outside the sparkline.

  • ts
  • onSparkLineMouseLeave(sender){
         
         //Do something
    
    }
  • html
  • <ej-sparkline id="events" (sparklineMouseLeave)="onSparkLineMouseLeave($event)">
    </ej-sparkline>