ChartPoint.getAnimParams

Syntax

getAnimParams();

Description

The getAnimParams method returns parameters of data series point animation.

Comments

The method returns a JSON object with the following fields: PlotX - screen X coordinate of the chart data series point, PlotY - screen coordinate for the first Y value of the point, PlotYBottom - screen coordinate for the second Y value of the point.

Example

To execute the example, the HTML page must contain the Chart component named chart (see Example of Creating a Stacked Histogram). Determine screen coordinates for the first point of the chart second data series before and after animation parameters for this point are reset:

// Show point animation parameters
function printAnimParams(point) {
    var params = point.getAnimParams();
    console.log("  Screen X coordinate of the point: %s", params.PlotX);
    console.log("  First value of the Y coordinate of the point: %s", params.PlotY);
    console.log("  Second value of the Y coordinate of the point: %s", params.PlotYBottom);
};
// Get the second data series
var serie = chart.getSeries()[1];
// Get the first point of the series
var point = serie.getPoints()[0];
// Show animation parameters for the point
console.log("Initial parameters of point animation:");
printAnimParams(point);
// Reset animation parameters
point.resetAnimParams();
console.log("Point animation parameters after they are reset:");
printAnimParams(point);

After executing the example the browser console shows coordinates for the first point of the second data series in the chart before and after animation parameters are reset:

Initial parameters of point animation:

  Screen X coordinate of the point: 58.34375

  First value of the Y coordinate of the point: 370.42857142857144

  Second value of the Y coordinate of the point: 370.42857142857144

Point animation parameters after they are reset:

  Screen X coordinate of the point: 58.34375

  First value of the Y coordinate of the point: 258.57142857142856

  Second value of the Y coordinate of the point: 370.42857142857144

See also:

ChartPoint