Public Methods

animate(options)

Animates the series and/or indicators in Chart. When parameter is not passed to this method, then all the series and indicators present in Chart are animated.

Following are the parameters that you can pass to this method.

Returns: void

Parameters Type Description
options object If an array collection is passed as parameter, series and indicator objects passed in array collection are animated.

Example
  • js
  • var chartObj  = $("#container").data("ejChart");
    //animating series array
    chartObj.animate(chartObj.model.series);

    If a series or indicator object is passed to this method, then the specific series or indicator is animated.

    Example,
  • js
  • var chartObj  = $("#container").data("ejChart");
    //animating a specific indicator
    chartObj.animate(chartObj.model.indicators[0]);

    print()

    Prints the rendered chart.

    Returns: void

    Example

  • js
  • // Print Chart
    var chartObj = $("#container").data("ejChart");
    chartObj.print();

    If you wish to print multiple charts on a same page, then you need to pass the ID of those elements as arguments to the print method.

  • js
  • // Print Chart
    var chartObj = $("#container1").data("ejChart");
    chartObj.print("container1","container2");

    export(type, URL, exportMultipleChart)

    Exports chart as an image or to an excel file. Chart can be exported as an image only when exportCanvasRendering option is set to true.

    Following are the parameters that you can pass to this method,

    Returns: object

    Parameters Type Description
    type string Type of the export operation to be performed. Following are the two export types that are supported now,
    1. 'image' 2. 'excel'
    Example
  • js
  • var chartObj  = $("#container").data("ejChart");
    chartObj.export(image);
    URL string URL of the service, where the chart will be exported to excel.

    Example,
  • js
  • var chartObj  = $("#container").data("ejChart");
    chartObj.export("excel", 'http://js.syncfusion.com/ExportingServices/api/JSChartExport/ExcelExport')
    exportMultipleChart boolean When this parameter is true, all the chart objects initialized to the same document are exported to a single excel file. This is an optional parameter. By default, it is false.

    Example,
  • js
  • var chartObj  = $("#container").data("ejChart");
    chartObj.export("excel", 'http://js.syncfusion.com/ExportingServices/api/JSChartExport/ExcelExport', true)

    redraw()

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

    Returns: void

    Example

  • js
  • // Redraw Chart
    var chartObj = $("#container").data("ejChart");
    chartObj.redraw();
  • js
  • $("#container").ejChart("redraw");