com.nchart3d.NChart.NChartValueAxis Class Reference

The NChartValueAxis class provides methods to display the value axis of the chart. More...

Inheritance diagram for com.nchart3d.NChart.NChartValueAxis:
com.nchart3d.NChart.NChartAxis com.nchart3d.NChart.NChartObject

Public Member Functions

NChartValueAxisKind getKind ()
 Kind of axis. More...
 
double getMinValue ()
 Minimal value on the axis. More...
 
double getMaxValue ()
 Maximal value on the axis. More...
 
double getStep ()
 Step from one tick to another. More...
 
String[] getTicks ()
 Array of strings that are displayed as ticks on the axis. More...
 
int getTickCount ()
 Number of ticks on the axis. More...
 
double getLength ()
 Length of axis in 3D scene units. More...
 
Date getMinDate ()
 Minimal date on the axis. More...
 
Date getMaxDate ()
 Maximal date on the axis. More...
 
double getDateStep ()
 Time interval from one date tick to another. More...
 
boolean hasDates ()
 Flag indicating if axis displays dates instead of values (true) or regular values (false). More...
 
void setHasDates (boolean hasDates)
 For details see hasDates().
 
int getColor ()
 Color of the axis line.
 
void setColor (int color)
 For details see getColor().
 
NChartFont getFont ()
 Font for the ticks' labels.
 
void setFont (NChartFont font)
 For details see getFont().
 
int getTextColor ()
 Color of the text for the ticks' labels.
 
void setTextColor (int textColor)
 For details see getTextColor().
 
boolean hasOffset ()
 Flag that determines if there should be an offset on the axis. More...
 
void setHasOffset (boolean hasOffset)
 For details see hasOffset().
 
float getMaxLabelLength ()
 Maximal allowed label length in pixels. More...
 
void setMaxLabelLength (float maxLabelLength)
 For details see getMaxLabelLength().
 
NChartLineBreakMode getLabelsLineBreakMode ()
 Line break mode for axis labels. More...
 
void setLabelsLineBreakMode (NChartLineBreakMode labelsLineBreakMode)
 For details see getLabelsLineBreakMode().
 
float getMinTickSpacing ()
 Minimal spacing between neighbor ticks in pixels (the tick is the center place for the tick label, a kind of milestone on the axis). More...
 
void setMinTickSpacing (float minTickSpacing)
 For details see getMinTickSpacing().
 
float getThickness ()
 Thickness of the axis' line in pixels.
 
void setThickness (float thickness)
 For details see getThickness().
 
NChartLineDash getLineDash ()
 Dash of the crosshair.
 
void setLineDash (NChartLineDash lineDash)
 For details see getLineDash().
 
NChartAxisTick getMajorTicks ()
 Major ticks of the axis. More...
 
NChartAxisTick getMinorTicks ()
 Minor ticks of the axis. More...
 
NChartAxisTick getTinyTicks ()
 Tiny ticks of the axis. More...
 
int getTinyTickIntervalsPerInterval ()
 Number of tiny intervals the interval between two consecutive major ticks is split up into. More...
 
void setTinyTickIntervalsPerInterval (int tinyTickIntervalsPerInterval)
 For details see getTinyTickIntervalsPerInterval().
 
boolean isContinuous ()
 Flag determining if axis is continuous (true) or not (false). More...
 
void setContinuous (boolean isContinuous)
 For details see isContinuous().
 
boolean isLogarithmic ()
 Flag determining if axis has logarithmic scale (true) or linear scale (false). More...
 
void setLogarithmic (boolean isLogarithmic)
 For details see isLogarithmic().
 
double getLogarithmBase ()
 Base of logarithm for logarithmic scale. More...
 
void setLogarithmBase (double logarithmBase)
 For details see getLogarithmBase().
 
NChartLabel getCaption ()
 Caption of the axis. More...
 
boolean isLabelsVisible ()
 Flag that determines if the labels of ticks are visible (true) or not (false). More...
 
void setLabelsVisible (boolean labelsVisible)
 For details see isLabelsVisible().
 
boolean isLineVisible ()
 Flag that determines if the line of the axis is visible (true) or not (false). More...
 
void setLineVisible (boolean lineVisible)
 For details see isLineVisible().
 
boolean isAlwaysShowZero ()
 Flag that determines whether zero is always on the axis. More...
 
void setAlwaysShowZero (boolean alwaysShowZero)
 For details see isAlwaysShowZero().
 
boolean isLabelsIn3D ()
 Flag that determines whether the axis labels are in "perspective" screen (true) or are projected in the 2D screen (false). More...
 
void setLabelsIn3D (boolean labelsIn3D)
 For details see isLabelsIn3D().
 
boolean isCaptionIn3D ()
 Flag that determines whether the axis caption is in "perspective" screen (true) or is projected in the 2D screen (false). More...
 
void setCaptionIn3D (boolean captionIn3D)
 For details see isCaptionIn3D().
 
boolean shouldBeautifyMinAndMax ()
 Flag that determines whether min and max values on the axis should be beautified in case they are calculated (true) or not (false). More...
 
void setShouldBeautifyMinAndMax (boolean beautifyMinAndMax)
 For details see shouldBeautifyMinAndMax().
 
float getLabelsAngle ()
 Axis labels' rotation angle. More...
 
void setLabelsAngle (float labelsAngle)
 For details see getLabelsAngle().
 
NChartAxisLabelsAlignment getLabelsAlignment ()
 Alignment of the axis labels relative to the axis ticks. More...
 
void setLabelsAlignment (NChartAxisLabelsAlignment labelsAlignment)
 For details see getLabelsAlignment().
 
NChartValueAxisDataSource getDataSource ()
 Data source of the axis. More...
 
void setDataSource (NChartValueAxisDataSource dataSource)
 For details see getDataSource().
 
NChartValueAxisDelegate getDelegate ()
 Delegate of the axis. More...
 
void setDelegate (NChartValueAxisDelegate delegate)
 For details see getDelegate().
 
void zoomToRegion (float startValue, float endValue, float duration, float delay)
 Zoom to given region by specifying the least and the greatest values that should be visible on the axis. More...
 
void zoomToRegion (Date startDate, Date endDate, float duration, float delay)
 Zoom to given region by specifying the earliest and the latest dates that should be visible on the axis. More...
 
NChartValueAxisMark[] getMarks ()
 Array of axis marks.
 
void addMark (NChartValueAxisMark mark)
 Add axis mark. More...
 
void removeMark (NChartValueAxisMark mark)
 Remove axis mark. More...
 
void removeAllMarks ()
 Remove all axis marks.
 
void calcOptimalMinTickSpacing ()
 Calculate optimal value for getMinTickSpacing(). More...
 
void fitZoomByMinTickSpacing (float duration, float delay)
 Fit the zoom according to the current getMinTickSpacing(). More...
 
boolean shouldAutoFitZoomByMinTickSpacing ()
 Flag determining if zoom of the axis should be automatically fit according to the current getMinTickSpacing() (true) or not (false). More...
 
void setShouldAutoFitZoomByMinTickSpacing (boolean shouldAutoFitZoomByMinTickSpacing)
 For details see shouldAutoFitZoomByMinTickSpacing().
 
NChartAxisPositionCoord getPositionX ()
 Coordinate controlling horizontal position of the axis. More...
 
NChartAxisPositionCoord getPositionY ()
 Coordinate controlling vertical position of the axis. More...
 
NChartAxisPositionCoord getPositionZ ()
 Coordinate controlling depth position of the axis. More...
 
boolean isFlipped ()
 Flag determining if value axis is flipped (displayed from max to min, true) or not (displayed from min to max, false). More...
 
void setFlipped (boolean isFlipped)
 For details see isFlipped().
 
NChartValueAxisRange visibleRange ()
 Get values (or dates, if the axis has dates) range visible on the screen in current chart zoom/pan position. More...
 
boolean getReferenceValueInZero ()
 Flag determining if the axis reference value is in its zero value (true) or minimal value (false). More...
 
void setReferenceValueInZero (boolean referenceValueInZero)
 For details see getReferenceValueInZero().
 
boolean isCaptionReversed ()
 Flag determining if axis caption is reversed (rotated 180 degrees, true) or not (false). More...
 
void setCaptionReversed (boolean isCaptionReversed)
 For details see isCaptionReversed().
 
- Public Member Functions inherited from com.nchart3d.NChart.NChartObject
boolean isVisible ()
 Flag that determines if the object is visible or not. More...
 
void setVisible (boolean visible)
 For details see isVisible().
 
NChart getChart ()
 Chart the object belongs to. More...
 

Detailed Description

The NChartValueAxis class provides methods to display the value axis of the chart.

Member Function Documentation

void com.nchart3d.NChart.NChartValueAxis.addMark ( NChartValueAxisMark  mark)
inline

Add axis mark.

Parameters
mark- mark to add.
void com.nchart3d.NChart.NChartValueAxis.calcOptimalMinTickSpacing ( )
inline

Calculate optimal value for getMinTickSpacing().

Use this method if you want to get getMinTickSpacing() that corresponds to the actual lengths of axis ticks' labels. You should call this method after the updateData call of the chart, because this method operates with the data obtained from data source. If you call it before the data are updated, the result will be wrong.

void com.nchart3d.NChart.NChartValueAxis.fitZoomByMinTickSpacing ( float  duration,
float  delay 
)
inline

Fit the zoom according to the current getMinTickSpacing().

Use this method if you want to zoom the chart so that the maximal number of points is visible with no skipping of ticks on the axis. This method requires frame of the chart to be determined. So if you call this method before the chart's layout, it will fail. If you want the axes to be automatically zoomed according to the getMinTickSpacing(), use the flag shouldAutoFitZoomByMinTickSpacing().

Parameters
duration- duration of the animation in seconds.
delay- delay of animation in seconds.
NChartLabel com.nchart3d.NChart.NChartValueAxis.getCaption ( )
inline

Caption of the axis.

See also
NChartLabel
NChartValueAxisDataSource com.nchart3d.NChart.NChartValueAxis.getDataSource ( )
inline

Data source of the axis.

See also
NChartValueAxisDataSource
double com.nchart3d.NChart.NChartValueAxis.getDateStep ( )
inline

Time interval from one date tick to another.

It is either obtained from the data source or, if not provided, calculated according to the minDate and maxDate to look beautiful. This property works in date mode only, if hasDates is true. Otherwise it returns 0.

NChartValueAxisDelegate com.nchart3d.NChart.NChartValueAxis.getDelegate ( )
inline

Delegate of the axis.

See also
NChartValueAxisDelegate
NChartValueAxisKind com.nchart3d.NChart.NChartValueAxis.getKind ( )
inline

Kind of axis.

See also
NChartValueAxisKind
NChartAxisLabelsAlignment com.nchart3d.NChart.NChartValueAxis.getLabelsAlignment ( )
inline

Alignment of the axis labels relative to the axis ticks.

The default value is NChartAxisLabelsAlignment.Center Alignment of the axis labels relative to the axis ticks. The default value for X-Axis is NChartAxisLabelsAlignment.Center, for Y-Axis is NChartAxisLabelsAlignment.Right, for Z-Axis is NChartAxisLabelsAlignment.Left.

float com.nchart3d.NChart.NChartValueAxis.getLabelsAngle ( )
inline

Axis labels' rotation angle.

See also
NChart::setDrawIn3D(boolean)
NChartValueAxis::isLabelsIn3D()
NChartLineBreakMode com.nchart3d.NChart.NChartValueAxis.getLabelsLineBreakMode ( )
inline

Line break mode for axis labels.

The default value is NSLineBreakByWordWrapping.

double com.nchart3d.NChart.NChartValueAxis.getLength ( )
inline

Length of axis in 3D scene units.

This value is obtained from the data source or, if not provided, is assigned to 1. It has an effect for axes being displayed in 3D only. In 2D this value is ignored because axes fill the whole area available on the screen. One 3D scene unit is equal to half a screen size by initial zoom (so space of the 3D scene is actually nonlinear respective to the screen). Therefore, by default all axes have equal length and form a kind of cube in 3D that is centered on the screen and is as big as half of the biggest screen's dimension. However, if you want, for example, to make the Z-axis shorter than the others, you can provide a length of 0.5 for it. It will therefore be twice as short as the others.

double com.nchart3d.NChart.NChartValueAxis.getLogarithmBase ( )
inline

Base of logarithm for logarithmic scale.

The default value is 10. This property takes effect if isLogarithmic() is set to true only.

NChartAxisTick com.nchart3d.NChart.NChartValueAxis.getMajorTicks ( )
inline

Major ticks of the axis.

Major ticks are spread from the getMinValue() to the getMaxValue() through getStep() or, if no getMinValue() and getMaxValue() are provided but a ticks array is provided, the whole axis length is divided by the number of ticks and for each tick there is a major tick displayed. Major ticks can be labeled.

See also
NChartAxisTick
Date com.nchart3d.NChart.NChartValueAxis.getMaxDate ( )
inline

Maximal date on the axis.

It is obtained from the data source and, if needed, processed to look more beautiful. This property works in date mode only, if hasDates is true. Otherwise it returns null.

float com.nchart3d.NChart.NChartValueAxis.getMaxLabelLength ( )
inline

Maximal allowed label length in pixels.

If 0, maximal label width is calculated automatically according to the length between neighbor ticks. The default value is 0.

double com.nchart3d.NChart.NChartValueAxis.getMaxValue ( )
inline

Maximal value on the axis.

It is obtained from the data source and, if needed, processed to look more beautiful.

Date com.nchart3d.NChart.NChartValueAxis.getMinDate ( )
inline

Minimal date on the axis.

It is obtained from the data source and, if needed, processed to look more beautiful. This property works in date mode only, if hasDates is true. Otherwise it returns null.

NChartAxisTick com.nchart3d.NChart.NChartValueAxis.getMinorTicks ( )
inline

Minor ticks of the axis.

Minor ticks are displayed in the middle between two neighbor major ticks. See majorTicks for details.

See also
NChartAxisTick
float com.nchart3d.NChart.NChartValueAxis.getMinTickSpacing ( )
inline

Minimal spacing between neighbor ticks in pixels (the tick is the center place for the tick label, a kind of milestone on the axis).

According to this value some labels can be hidden, if there are too many of them. The default value is 50.

double com.nchart3d.NChart.NChartValueAxis.getMinValue ( )
inline

Minimal value on the axis.

It is obtained from the data source and, if needed, processed to look more beautiful.

NChartAxisPositionCoord com.nchart3d.NChart.NChartValueAxis.getPositionX ( )
inline

Coordinate controlling horizontal position of the axis.

See also
NChartAxisPositionCoord
NChartAxisPositionCoord com.nchart3d.NChart.NChartValueAxis.getPositionY ( )
inline

Coordinate controlling vertical position of the axis.

See also
NChartAxisPositionCoord
NChartAxisPositionCoord com.nchart3d.NChart.NChartValueAxis.getPositionZ ( )
inline

Coordinate controlling depth position of the axis.

See also
NChartAxisPositionCoord
boolean com.nchart3d.NChart.NChartValueAxis.getReferenceValueInZero ( )
inline

Flag determining if the axis reference value is in its zero value (true) or minimal value (false).

The default value is true. The reference value is kind of "floor" value used by some of the series. For example, columns and bars use reference to indicate where to "grow" from. If this value is YES and there are positive and negative values in the series data, columns with positive value will grow up from zero and the ones with negative value will grow down from zero. Otherwise, if this flag is false, all the columns will grow up from minimum.

double com.nchart3d.NChart.NChartValueAxis.getStep ( )
inline

Step from one tick to another.

It is either obtained from the data source or, if not provided, calculated according to the getMinValue() and getMaxValue() to look beautiful.

int com.nchart3d.NChart.NChartValueAxis.getTickCount ( )
inline

Number of ticks on the axis.

It is the number of ticks in an array or the number of values between getMinValue() and getMaxValue() through getStep().

String [] com.nchart3d.NChart.NChartValueAxis.getTicks ( )
inline

Array of strings that are displayed as ticks on the axis.

It is obtained from the data source or null if not provided.

int com.nchart3d.NChart.NChartValueAxis.getTinyTickIntervalsPerInterval ( )
inline

Number of tiny intervals the interval between two consecutive major ticks is split up into.

Tiny intervals are bounded with the tiny ticks. The default value is 0, which means no tiny ticks are displayed. If for example this value is 10, that means each interval between two labels is split up into 10 sub-intervals and therefore should have 11 tiny ticks inside. However, only 8 tiny ticks will be visible, and 1th, 6th and 11th ticks will be discarded, because they potentially overlap with major/minor ticks (even if major/minor ticks are switched off).

NChartAxisTick com.nchart3d.NChart.NChartValueAxis.getTinyTicks ( )
inline

Tiny ticks of the axis.

Tiny ticks are displayed between consecutive major ticks. However there is a gap in tiny ticks where tiny ticks potentially overlap with major/minor ticks (even if major/minor ticks are switched off). See majorTicks, minorTicks and tinyTickIntervalsPerInterval for details.

See also
NChartAxisTick
boolean com.nchart3d.NChart.NChartValueAxis.hasDates ( )
inline

Flag indicating if axis displays dates instead of values (true) or regular values (false).

The default value is false.

boolean com.nchart3d.NChart.NChartValueAxis.hasOffset ( )
inline

Flag that determines if there should be an offset on the axis.

The offset is the spacing from the beginning of the axis to the first tick and from the last tick to the end of the axis. If this flag is true, the spacing is half a step. If false, spacing is zero.

boolean com.nchart3d.NChart.NChartValueAxis.isAlwaysShowZero ( )
inline

Flag that determines whether zero is always on the axis.

This flag makes sense if getMinValue() and getMaxValue() are both less or greater than zero and are beautified according to the data source. In this case, if this flag is false, it may happen, that no zero will be on the axis (for example, if getMinValue() = 11.5 and getMaxValue() = 19, the axis will probably start with 10 and end with 20, having 4 steps). With this flag set to true, zero will always be on the axis, so even with getMinValue() = 11.5 and getMaxValue() = 19 the axis will start with 0 and end with 20 having probably 5 steps or so. The default value is false.

boolean com.nchart3d.NChart.NChartValueAxis.isCaptionIn3D ( )
inline

Flag that determines whether the axis caption is in "perspective" screen (true) or is projected in the 2D screen (false).

This flag only affects 3D-charts. The default value is true.

boolean com.nchart3d.NChart.NChartValueAxis.isCaptionReversed ( )
inline

Flag determining if axis caption is reversed (rotated 180 degrees, true) or not (false).

The default value is false.

boolean com.nchart3d.NChart.NChartValueAxis.isContinuous ( )
inline

Flag determining if axis is continuous (true) or not (false).

The default value is true. Continuous axis changes its step when chart is zoomed in. For example, if the step of axis is 1 and this flag is set to true, than, when you zoom the chart in, the step will be changed to 0.5, then to 0.25 and so on. However if this flag is set to false, the step will remain to be 1. Note, that if you zoom out and there is not enough place for ticks, the step will be changed independently of this flag to skip some ticks and avoid overlapping. You can control this skipping by getMinTickSpacing() property. If the axis has discrete ticks, this property is ignored.

boolean com.nchart3d.NChart.NChartValueAxis.isFlipped ( )
inline

Flag determining if value axis is flipped (displayed from max to min, true) or not (displayed from min to max, false).

The default value is false.

boolean com.nchart3d.NChart.NChartValueAxis.isLabelsIn3D ( )
inline

Flag that determines whether the axis labels are in "perspective" screen (true) or are projected in the 2D screen (false).

This flag only affects 3D-charts. The default value is true.

boolean com.nchart3d.NChart.NChartValueAxis.isLabelsVisible ( )
inline

Flag that determines if the labels of ticks are visible (true) or not (false).

The default value is true.

boolean com.nchart3d.NChart.NChartValueAxis.isLineVisible ( )
inline

Flag that determines if the line of the axis is visible (true) or not (false).

The default value is false.

boolean com.nchart3d.NChart.NChartValueAxis.isLogarithmic ( )
inline

Flag determining if axis has logarithmic scale (true) or linear scale (false).

The default value is false. The base of scale's logarithm is controlled by getLogarithmBase() property.

void com.nchart3d.NChart.NChartValueAxis.removeMark ( NChartValueAxisMark  mark)
inline

Remove axis mark.

Parameters
mark- mark to remove.
boolean com.nchart3d.NChart.NChartValueAxis.shouldAutoFitZoomByMinTickSpacing ( )
inline

Flag determining if zoom of the axis should be automatically fit according to the current getMinTickSpacing() (true) or not (false).

The default value is false. Set this flag to true if you want to zoom the chart so that the maximal number of points is visible with no skipping of ticks on the axis. Best practice is to set this flag and call calcOptimalMinTickSpacing(). If this flag is set to true, zoom of the axis is changed automatically by each chart's layout. Zoom you set manually before layout will be ignored. Auto fitting works in 2D mode only.

boolean com.nchart3d.NChart.NChartValueAxis.shouldBeautifyMinAndMax ( )
inline

Flag that determines whether min and max values on the axis should be beautified in case they are calculated (true) or not (false).

The default value is true.

NChartValueAxisRange com.nchart3d.NChart.NChartValueAxis.visibleRange ( )
inline

Get values (or dates, if the axis has dates) range visible on the screen in current chart zoom/pan position.

You can alter this value by zoomToRegion call.

void com.nchart3d.NChart.NChartValueAxis.zoomToRegion ( float  startValue,
float  endValue,
float  duration,
float  delay 
)
inline

Zoom to given region by specifying the least and the greatest values that should be visible on the axis.

If the axis has array of ticks, indices in this array can be used. Use this method after you updated data of the chart with NChart#updateData() call.

Parameters
startValue- least value that should be visible.
endValue- greatest value that should be visible.
duration- duration of the animation in seconds.
delay- delay of animation in seconds.
void com.nchart3d.NChart.NChartValueAxis.zoomToRegion ( Date  startDate,
Date  endDate,
float  duration,
float  delay 
)
inline

Zoom to given region by specifying the earliest and the latest dates that should be visible on the axis.

This method works in date mode only, if hasDates is true. Use this method after you updated data of the chart with chart.updateData() call.

Parameters
startDate- earliest date that should be visible.
endDate- latest date that should be visible.
duration- duration of the animation in seconds.
delay- delay of animation in seconds.