Axis 3D APIs
There are several axis types in SciChart Android 3D. The IAxis3D are the logical representation of the XZ
, ZY
, YX
planes in the Axis Cube.
Axes are required to measure the IRenderableSeries3D, for instance, an axis is responsible for the transformation between data-values (provided by your code) and world coordinates (X
, Y
, Z
values in 3D Space).
Note
It is necessary to declare all X, Y and Z Axes in code before the 3D chart will draw. They are accessible via the following properties:
A list of the 3D axis types are found below:
All the 3D axis types in SciChart conforms to the IAxis3D protocol.
NumericAxis3D
The NumericAxis3D is a Value-Axis and is suitable when the data type on that axis is numeric (e.g. double, int, long, float, short). It is not suitable for non-numeric data types such as Android Date.
To create and configure a NumericAxis3D, use the following code:
final NumericAxis3D axis = new NumericAxis3D();
axis.setGrowBy(new DoubleRange(0.1, 0.1));
axis.setVisibleRange(new DoubleRange(-7.0, 7.0));
LogarithmicNumericAxis3D
The LogarithmicNumericAxis3D is a Value axis which uses non-linear (logarithmic) scale. It is suitable when the data is numeric (e.g. double, int, long, float, short). It is not suitable for non-numeric data types such as Android Date.
Note
The LogarithmicNumericAxis3D cannot render data values less than or equal to zero. Please ensure you append valid data to your DataSeries.
To create and configure a LogarithmicNumericAxis3D, use the following code:
final LogarithmicNumericAxis3D axis = new LogarithmicNumericAxis3D();
axis.setGrowBy(new DoubleRange(0.1, 0.1));
axis.setVisibleRange(new DoubleRange(0.1, 1000.0));
// Specifies how labels appear on the axis
axis.setScientificNotation(ScientificNotation.LogarithmicBase);
axis.setCursorTextFormatting("#.#E+0");
// Specifies the logarithm base for the logarithmic scale of the axis
axis.setLogarithmicBase(10.0);
DateAxis3D
The DateAxis3D is a Value axis, which is designed to work with dates only.
Note
The DateAxis3D is not suitable for numeric data types.
To create and configure a DateAxis3D, use the following code:
final DateAxis3D axis = new DateAxis3D();
axis.setAutoRange(AutoRange.Always);
axis.setGrowBy(new DoubleRange(0.1, 0.1));
axis.setVisibleRange(new DateRange(dateMin, dateMax));
Note
To learn more about how to convert values from Dates to Indexes and back, please refer to the Convert Pixels to Data Coordinates article.
See the Axis 3D Types in action
Please take a look at the examples from the Android Examples Suite listed below to see these axis 3D types in action: