Axis

This section is regarding Methods and Properties available in all Axis Elements – axisX, axisY, axisX2 & axisY2.


Example :
    chart.axisX[0].get(“title”);
    chart.axisX[0].convertValueToPixel( 20 );

Note
  • Chart should be rendered before you can access Axis & its methods / properties.

Axis Methods:

Method Description Example
get(String propertyName) Returns the specified property of Axis chart.axisX[0].get(“minimum”);
set(String propertyName, Mixed value [,Boolean updateChart = true]) Sets the specified property of Axis & optionally updates (default) the chart chart.axisX[0].set(“minimum”, 10, true);
addTo(String arrayName, Object options [, Number index = array.length]) Adds a new element of given type to the specified array. chart.axisX[0].addTo(“stripLines”, {value: 20});
remove([Boolean updateChart = true]) Remove the specified axis chart.axisX[2].remove();
convertValueToPixel(Number value) Converts value in axis Scale to Pixel Coordinates chart.axisX[0].convertValueToPixel(20);
convertPixelToValue(Number pixel) Converts given pixel value to axis Scale chart.axisX[0].convertPixelToValue(250);

Read-Only Axis Properties:

Can be accessed via get method or dot notation.


Property Description Example
bounds Bounding rectangle of Axis: {x1, x2, y1, y2} chart.bounds / chart.axisX[0].get(“bounds”)

Writable Properties in Axis:

All Axis options become available as properties after Chart Render. You can access them either via get method or dot notation. But you can change / set those values only via set method.

Please refer to Axis Element for complete list of properties available.


Try it Yourself by Editing the Code below.


If you have any questions, please feel free to ask in our forums.Ask Question