Chart.Center

Syntax

Center: Object;

Description

The Center property determines chart center.

Comments

The property is read-only.

Property value is set only for the charts that use polar coordinates system (see Chart.Polar).

Chart center in the property is represented by the object with the following fields:

Example

Executing the example requires that the HTML page contains a Chart component named chart (see Example of Creating a Pie Chart). Check if polar coordinates system is set for the chart and next get coordinates of the chart center:

// Check if polar coordinates system is set for the chart
if (chart.getPolar() === true) {
    // Get coordinates of the chart center
    var center = chart.getCenter();
    // Display coordinates of the chart center to the browser console
    console.log("Coordinates of the chart center:");
    console.log("X: " + center.X);
    console.log("Y: " + center.Y);
}

After executing the example the browser console displays coordinates of the pie chart center:

Coordinates of the chart center:

X: 150

Y: 125

See also:

Chart