The NChartStaticLine class provides methods to control static lines displayed on top of the chart. More...
Public Member Functions | |
NChartStaticLine () | |
Create new static line instance. | |
int | getColor () |
Color of the static line. More... | |
void | setColor (int color) |
For details see getColor(). | |
float | getThickness () |
Thickness of the static line. More... | |
void | setThickness (float thickness) |
For details see getThickness(). | |
float | getPosition () |
Position of static line relative to the chart plot area. More... | |
void | setPosition (float position) |
For details see getPosition(). | |
NChartInterpolationRange | nearestPointIndices (NChartSeries series) |
Get indices and interpolation parameter of nearest points relative to the static line (taking into account current chart position). More... | |
NChartPointState | underlyingPointState (NChartSeries series, boolean shouldInterpolate) |
Get chart point state of given series under the static line (taking into account current chart position). More... | |
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 NChartStaticLine class provides methods to control static lines displayed on top of the chart.
These lines do not move with the chart and do not respond to any user interactions. They can be used as custom borders, indicators, static grid, etc.
Member Function Documentation
|
inline |
Color of the static line.
The default value is black color.
|
inline |
Position of static line relative to the chart plot area.
The default value is 0.5, which means the middle of the plot area.
|
inline |
Thickness of the static line.
The default value is 1.0.
|
inline |
Get indices and interpolation parameter of nearest points relative to the static line (taking into account current chart position).
- Parameters
-
series - series to get points of.
- Returns
- an instance of interpolation range. Its properties have following meaning:
left
- reference to the variable where to write nearest point left to the static line. If no points of series are left to the static line, the value is -1.right
- reference to the variable where to write nearest point right to the static line. If no points of series are right to the static line, the value is -1.t
- interpolation parameter in range [0; 1], if static line is between points with indicesleft
andright
, -1 otherwise.
|
inline |
Get chart point state of given series under the static line (taking into account current chart position).
The state contains values only (this means brush
, borderBrush
and marker
properties are undefined).
- Parameters
-
series - series to get the point state for. shouldInterpolate - flag indicating if the values should be interpolated between neighbor points (true) or the nearest point value should be used (false).
- Returns
- point state or null, if the series has no data under the static line.