-
- All Implemented Interfaces:
-
com.patrykandpatrick.vico.core.chart.values.ChartValuesProvider
public final class ChartValuesManager implements ChartValuesProvider
Manages the ChartValues used by a chart. There may be many ChartValues, but all of them have the same ChartValues.minX and ChartValues.maxX values. The following ChartValues instances exist in a chart:
A main ChartValues instance, which is used by all components by default. It’s accessible with a null key and always available in the drawing phase.
A ChartValues instance for AxisRenderers with AxisPosition.Vertical.Start. It’s available when the Chart is configured to use AxisPosition.Vertical.Start as a key to update and retrieve its ChartValues.
A ChartValues instance for AxisRenderers with AxisPosition.Vertical.End. It’s available when the Chart is configured to use AxisPosition.Vertical.End as a key to update and retrieve its ChartValues.
-
-
Constructor Summary
Constructors Constructor Description ChartValuesManager()
-
Method Summary
Modifier and Type Method Description final MutableChartValuesgetChartValues(AxisPosition.Vertical axisPosition)Returns the ChartValues associated with the given axisPosition. ChartValuesgetChartValues()Returns the Chart’s main ChartValues. ChartValuesgetChartValuesForAxisPosition(AxisPosition.Vertical axisPosition)Returns the ChartValues associated with the specified AxisPosition.Vertical subclass, or nullif there is no such association.final UnittryUpdate(Float minX, Float maxX, Float minY, Float maxY, Float xStep, ChartEntryModel chartEntryModel, AxisPosition.Vertical axisPosition)Attempts to update the stored values to the provided values. final UnitresetChartValues()Resets the values stored in each of the ChartValues instances in the chartValues map. -
-
Method Detail
-
getChartValues
final MutableChartValues getChartValues(AxisPosition.Vertical axisPosition)
Returns the ChartValues associated with the given axisPosition.
- Parameters:
axisPosition- if this is null, the main ChartValues instance is returned.
-
getChartValues
ChartValues getChartValues()
Returns the Chart’s main ChartValues.
-
getChartValuesForAxisPosition
ChartValues getChartValuesForAxisPosition(AxisPosition.Vertical axisPosition)
Returns the ChartValues associated with the specified AxisPosition.Vertical subclass, or
nullif there is no such association.
-
tryUpdate
final Unit tryUpdate(Float minX, Float maxX, Float minY, Float maxY, Float xStep, ChartEntryModel chartEntryModel, AxisPosition.Vertical axisPosition)
Attempts to update the stored values to the provided values. MutableChartValues.minX and MutableChartValues.minY can be updated to a lower value. MutableChartValues.maxX and MutableChartValues.maxY can be updated to a higher value. MutableChartValues.chartEntryModel and MutableChartValues.xStep are always updated. If axisPosition is null, only the main ChartValues are updated. Otherwise, both the main ChartValues and the ChartValues associated with the given axisPosition are updated.
-
resetChartValues
final Unit resetChartValues()
Resets the values stored in each of the ChartValues instances in the chartValues map.
-
-
-
-