The NChartValueAxis class provides methods to display the value axis of the chart. More...
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
|
inline |
Add axis mark.
- Parameters
-
mark - mark to add.
|
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.
|
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.
|
inline |
Caption of the axis.
- See also
- NChartLabel
|
inline |
Data source of the axis.
- See also
- NChartValueAxisDataSource
|
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.
|
inline |
Delegate of the axis.
- See also
- NChartValueAxisDelegate
|
inline |
Kind of axis.
- See also
- NChartValueAxisKind
|
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.
|
inline |
Axis labels' rotation angle.
|
inline |
Line break mode for axis labels.
The default value is NSLineBreakByWordWrapping.
|
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.
|
inline |
Base of logarithm for logarithmic scale.
The default value is 10. This property takes effect if isLogarithmic() is set to true only.
|
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
|
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.
|
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.
|
inline |
Maximal value on the axis.
It is obtained from the data source and, if needed, processed to look more beautiful.
|
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.
|
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
|
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.
|
inline |
Minimal value on the axis.
It is obtained from the data source and, if needed, processed to look more beautiful.
|
inline |
Coordinate controlling horizontal position of the axis.
- See also
- NChartAxisPositionCoord
|
inline |
Coordinate controlling vertical position of the axis.
- See also
- NChartAxisPositionCoord
|
inline |
Coordinate controlling depth position of the axis.
- See also
- NChartAxisPositionCoord
|
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.
|
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.
|
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().
|
inline |
Array of strings that are displayed as ticks on the axis.
It is obtained from the data source or null if not provided.
|
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).
|
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
|
inline |
Flag indicating if axis displays dates instead of values (true) or regular values (false).
The default value is false.
|
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.
|
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.
|
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.
|
inline |
Flag determining if axis caption is reversed (rotated 180 degrees, true) or not (false).
The default value is false.
|
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.
|
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.
|
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.
|
inline |
Flag that determines if the labels of ticks are visible (true) or not (false).
The default value is true.
|
inline |
Flag that determines if the line of the axis is visible (true) or not (false).
The default value is false.
|
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.
|
inline |
Remove axis mark.
- Parameters
-
mark - mark to remove.
|
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.
|
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.
|
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.
|
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.
|
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.