Introduction
Set Axis
Scale
Format
Axis Color
Axis
Thickness/Show Axis
Show
2D Arrowhead
Show
Gridlines
Set Scale
through Time-Based Zooming
Label
and Ticker
Note that pie chart does not support Axis.
Introduction
To set properties on the
Axis grid, labels, range, intervals...etc, first create an IAxis object
that has a handle on the chart's Axis that would be edited. Then,
the minimum, maximum, step intervals...etc can be set by using the setMinScale,
setMaxScale, setScaleStep... etc. Please refer to IAxis in the EspressChart
API DOCS if additional information is desired. Some examples are
provided below.
// create an IAxis object that has a handle on X-AxisSet Axis Scale
IAxis hXAxis = chart.gethXAxis();
// For y axis : chart.gethYAxis();
// For z axis : chart.gethZAxis();
// For 2nd axis : chart.gethSecondaryChart().gethAxis();
// only works for value axisFormat Axis Color
// override the automatic X-Axis scale
hXAxis.setScaleAutomatic(false);// set min = 0, max = 42, marker interval = 6
hXAxis.setMinScale(new Integer(0));
hXAxis.setMaxScale(new Integer(42));
hXAxis.setScaleStep(new Integer(6));
// set all Axis Color to redAxis Thickness/Show Axis
hXAxis.setColor( Color.red);
// set X-Axis thickness to 3 pixels, make it visibleShow 2D Arrowhead
hXAxis.setThickness( 3 );
hXAxis.setVisible( true );
// set all Axis arrowhead invisibleShow Gridlines
hXAxis.setArrowhead( false);
// make vertical gridlines visibleSet Scale through Time-Based Zooming
// (horizontal gridlines are set through the Y Axis)
hXAxis.setGridVisible(true);
// set gridlines to front
hXAxis.setGridInFront(true);
// create lower and upper bound valuesLabel and Ticker
int currentMonth = 2; // March
int startingDay = 5, endingDay = 18;
Date lower = new Date(100, currentMonth, startingDay);
Date upper = new Date(100, currentMonth, endingDay);// Enable Zooming
IZoomInfo hZoomInfo = chart.gethZoomInfo();
hZoomInfo.setMinScale(1, IZoomInfo.DAY);
hZoomInfo.setMaxScale(1, IZoomInfo.DAY);
hZoomInfo.setScale(1, IZoomInfo.DAY);
hZoomInfo.setZoomEnabled(true);// set EspressChart to “add” when combining data points
hZoomInfo.setAggregateOperator(IZoomInfo.SUM);// set lower and upper bounds
hZoomInfo.setLowerBound(lower);
hZoomInfo.setUpperBound(upper);// use linear scale
hZoomInfo.setLinearScale(true);
Please refer to
IAxis,
IDataPointSet,
&
IZoomInfo
in EspressChart
APIDocs for additional information.