public abstract class CategoryLabelProviderBase<T extends CategoryAxisBase> extends FormatterLabelProviderBase<T> implements ICategoryLabelProvider
axis
Modifier | Constructor and Description |
---|---|
protected |
CategoryLabelProviderBase(java.lang.Class<T> axisType,
ILabelFormatter<T> labelFormatter)
Creates a new instance of
CategoryLabelProviderBase class. |
Modifier and Type | Method and Description |
---|---|
java.lang.CharSequence |
formatCursorLabel(java.lang.Comparable dataValue)
Formats a label for the cursor, from the specified data-value passed in
|
java.lang.CharSequence |
formatLabel(java.lang.Comparable dataValue)
Formats a label for the axis from the specified data-value passed in
|
double |
getBarTimeFrame()
Gets the Bar Time Frame in seconds.
|
int |
transformDataToIndex(java.util.Date dataValue)
Transforms a
Date value to the nearest data point index. |
int |
transformDataToIndex(java.util.Date dataValue,
com.scichart.data.numerics.SearchMode mode)
Transforms a
Date value to the corresponding data point index using the specified search mode. |
protected <TDataValue extends java.lang.Comparable<TDataValue>> |
transformDataToIndexInternal(double dataValue,
com.scichart.data.numerics.SearchMode mode,
com.scichart.data.model.ISmartList<TDataValue> xValues,
com.scichart.data.numerics.math.IMath<TDataValue> xMath)
Finds index of the data-value in the point-series using corresponding
SearchMode |
java.util.Date |
transformIndexToData(int index)
Transforms an index of a data point to the corresponding (@link Date) data value.
|
protected <TDataValue extends java.lang.Comparable<TDataValue>> |
transformIndexToDataInternal(int index,
com.scichart.data.model.ISmartList<TDataValue> xValues,
com.scichart.data.numerics.math.IMath<TDataValue> xMath)
Finds the dataValue based on it's index in the corresponding xValues collection.
|
void |
update()
Updates provider with new data
|
protected abstract <TValue extends java.lang.Comparable<TValue>> |
updateBarTimeFrame(T axis,
com.scichart.data.model.ISmartList<TValue> xValues,
com.scichart.data.numerics.math.IMath<TValue> xMath)
Updates this label provider with new data
|
getFormattedTickLabels, updateFormattedTickLabelsFor
attachTo, detach, isAttached
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormattedTickLabels
protected CategoryLabelProviderBase(java.lang.Class<T> axisType, ILabelFormatter<T> labelFormatter)
CategoryLabelProviderBase
class.axisType
- The supported axis type.labelFormatter
- The ILabelFormatter
used by this label provider.public final double getBarTimeFrame()
CategoryDateAxis
and is required for proper rendering.getBarTimeFrame
in interface ICategoryLabelProvider
public void update()
update
in interface IAxisProviderBase
update
in class FormatterLabelProviderBase<T extends CategoryAxisBase>
protected abstract <TValue extends java.lang.Comparable<TValue>> double updateBarTimeFrame(T axis, com.scichart.data.model.ISmartList<TValue> xValues, com.scichart.data.numerics.math.IMath<TValue> xMath)
TValue
- The type of data inside xValues ISmartList
axis
- The parent axisxValues
- The xValues used by this label providerxMath
- The xMath used by this label providerpublic java.lang.CharSequence formatLabel(java.lang.Comparable dataValue)
formatLabel
in interface ILabelProvider
formatLabel
in class FormatterLabelProviderBase<T extends CategoryAxisBase>
dataValue
- The data value to formatpublic java.lang.CharSequence formatCursorLabel(java.lang.Comparable dataValue)
formatCursorLabel
in interface ILabelProvider
formatCursorLabel
in class FormatterLabelProviderBase<T extends CategoryAxisBase>
dataValue
- The data value to formatpublic final int transformDataToIndex(java.util.Date dataValue)
Date
value to the nearest data point index.transformDataToIndex
in interface ICategoryLabelProvider
dataValue
- The Date
valueprotected <TDataValue extends java.lang.Comparable<TDataValue>> int transformDataToIndexInternal(double dataValue, com.scichart.data.numerics.SearchMode mode, com.scichart.data.model.ISmartList<TDataValue> xValues, com.scichart.data.numerics.math.IMath<TDataValue> xMath)
SearchMode
TDataValue
- The type of data inside xValues ISmartList
dataValue
- Value to which this transformation will be applied.mode
- The SearchMode
, which will be used to search in ISmartList
xValues
- The x values collection.xMath
- The IMath
associated with TDataValue type.public final int transformDataToIndex(java.util.Date dataValue, com.scichart.data.numerics.SearchMode mode)
Date
value to the corresponding data point index using the specified search mode.transformDataToIndex
in interface ICategoryLabelProvider
dataValue
- The Date
valuemode
- The search modepublic final java.util.Date transformIndexToData(int index)
transformIndexToData
in interface ICategoryLabelProvider
index
- The indexprotected <TDataValue extends java.lang.Comparable<TDataValue>> double transformIndexToDataInternal(int index, com.scichart.data.model.ISmartList<TDataValue> xValues, com.scichart.data.numerics.math.IMath<TDataValue> xMath)
TDataValue
- The type of data inside xValues ISmartList
index
- Index of the sought dataValue.xValues
- The x values collection.xMath
- The IMath
associated with TDataValue type.