-
- All Implemented Interfaces:
-
com.patrykandpatrick.vico.core.chart.insets.ChartInsetter,com.patrykandpatrick.vico.core.dimensions.BoundsAware
public interface Chart<Model extends Object> implements BoundsAware, ChartInsetter
Defines the minimal set of properties and functions required by other parts of the library to draw a chart.
-
-
Method Summary
Modifier and Type Method Description abstract UnitdrawScrollableContent(ChartDrawContext context, Model model)Responsible for drawing the chart itself and any decorations behind it. abstract UnitdrawNonScrollableContent(ChartDrawContext context, Model model)Responsible for drawing any decorations placed above the chart, as well as persistent markers. abstract BooleanaddDecoration(Decoration decoration)Adds a Decoration to this Chart. abstract UnitsetDecorations(List<Decoration> decorations)Replaces the current list of decorations with the provided decorations. abstract BooleanremoveDecoration(Decoration decoration)Removes a Decoration from this Chart. BooleanremoveDecorations(List<Decoration> decorations)Removes each Decoration from decorations from this Chart. abstract UnitaddPersistentMarker(Float x, Marker marker)Adds a persistent Marker to this Chart. abstract UnitsetPersistentMarkers(Map<Float, Marker> markers)Replaces the current map of markers with the provided markers. abstract UnitremovePersistentMarker(Float x)Removes a persistent Marker from this Chart. abstract HorizontalDimensionsgetHorizontalDimensions(MeasureContext context, Model model)Called to get the HorizontalDimensions of this chart. abstract UnitupdateChartValues(ChartValuesManager chartValuesManager, Model model, Float xStep)Updates the ChartValues stored in the provided ChartValuesManager instance to this Chart’s ChartValues. abstract Map<Float, List<Marker.EntryModel>>getEntryLocationMap()Links x-axis values to Marker.EntryModels. abstract Collection<ChartInsetter>getChartInsetters()A Collection of the ChartInsetters that are part of this Chart. abstract AxisValuesOverrider<Model>getAxisValuesOverrider()Overrides the minimum and maximum x-axis and y-axis values. abstract UnitsetAxisValuesOverrider(AxisValuesOverrider<Model> axisValuesOverrider)Overrides the minimum and maximum x-axis and y-axis values. abstract FloatgetMinY()The minimum value shown on the y-axis. abstract UnitsetMinY(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float minY)The minimum value shown on the y-axis. abstract FloatgetMaxY()The maximum value shown on the y-axis. abstract UnitsetMaxY(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float maxY)The maximum value shown on the y-axis. abstract FloatgetMinX()The minimum value shown on the x-axis. abstract UnitsetMinX(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float minX)The minimum value shown on the x-axis. abstract FloatgetMaxX()The maximum value shown on the x-axis. abstract UnitsetMaxX(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float maxX)The maximum value shown on the x-axis. abstract RectFgetBounds()The bounds of the abstract component. -
-
Method Detail
-
drawScrollableContent
abstract Unit drawScrollableContent(ChartDrawContext context, Model model)
Responsible for drawing the chart itself and any decorations behind it.
-
drawNonScrollableContent
abstract Unit drawNonScrollableContent(ChartDrawContext context, Model model)
Responsible for drawing any decorations placed above the chart, as well as persistent markers.
-
addDecoration
abstract Boolean addDecoration(Decoration decoration)
Adds a Decoration to this Chart.
-
setDecorations
abstract Unit setDecorations(List<Decoration> decorations)
Replaces the current list of decorations with the provided decorations.
-
removeDecoration
abstract Boolean removeDecoration(Decoration decoration)
Removes a Decoration from this Chart.
-
removeDecorations
Boolean removeDecorations(List<Decoration> decorations)
Removes each Decoration from decorations from this Chart.
-
addPersistentMarker
abstract Unit addPersistentMarker(Float x, Marker marker)
-
setPersistentMarkers
abstract Unit setPersistentMarkers(Map<Float, Marker> markers)
Replaces the current map of markers with the provided markers.
-
removePersistentMarker
abstract Unit removePersistentMarker(Float x)
-
getHorizontalDimensions
abstract HorizontalDimensions getHorizontalDimensions(MeasureContext context, Model model)
Called to get the HorizontalDimensions of this chart. The HorizontalDimensions influence the look of various parts of the chart.
- Parameters:
context- holds data used for component measurements.model- holds data about the Chart’s entries.
-
updateChartValues
abstract Unit updateChartValues(ChartValuesManager chartValuesManager, Model model, Float xStep)
Updates the ChartValues stored in the provided ChartValuesManager instance to this Chart’s ChartValues.
- Parameters:
chartValuesManager- the ChartValuesManager whose properties will be updated.model- holds data about the Chart’s entries.xStep- the overridden x step (ornullif no override has occurred).
-
getEntryLocationMap
abstract Map<Float, List<Marker.EntryModel>> getEntryLocationMap()
Links x-axis values to Marker.EntryModels. A Marker.EntryModel holds the data needed to draw a Marker.
-
getChartInsetters
abstract Collection<ChartInsetter> getChartInsetters()
A Collection of the ChartInsetters that are part of this Chart. Each ChartInsetter can influence the final layout of the chart and its components.
-
getAxisValuesOverrider
abstract AxisValuesOverrider<Model> getAxisValuesOverrider()
Overrides the minimum and maximum x-axis and y-axis values. In the case of ColumnCharts and LineCharts contained in ComposedCharts, these overrides can be applied to one vertical axis instead of both. Use ColumnChart.targetVerticalAxisPosition and LineChart.targetVerticalAxisPosition for this purpose.
-
setAxisValuesOverrider
abstract Unit setAxisValuesOverrider(AxisValuesOverrider<Model> axisValuesOverrider)
Overrides the minimum and maximum x-axis and y-axis values. In the case of ColumnCharts and LineCharts contained in ComposedCharts, these overrides can be applied to one vertical axis instead of both. Use ColumnChart.targetVerticalAxisPosition and LineChart.targetVerticalAxisPosition for this purpose.
-
getMinY
abstract Float getMinY()
The minimum value shown on the y-axis. If Model implements ChartEntryModel, and minY is not null, this overrides ChartEntryModel.minY.
-
setMinY
abstract Unit setMinY(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float minY)
The minimum value shown on the y-axis. If Model implements ChartEntryModel, and minY is not null, this overrides ChartEntryModel.minY.
-
getMaxY
abstract Float getMaxY()
The maximum value shown on the y-axis. If Model implements ChartEntryModel, and maxY is not null, this overrides ChartEntryModel.maxY.
-
setMaxY
abstract Unit setMaxY(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float maxY)
The maximum value shown on the y-axis. If Model implements ChartEntryModel, and maxY is not null, this overrides ChartEntryModel.maxY.
-
getMinX
abstract Float getMinX()
The minimum value shown on the x-axis. If Model implements ChartEntryModel, and minX is not null, this overrides ChartEntryModel.minX.
-
setMinX
abstract Unit setMinX(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float minX)
The minimum value shown on the x-axis. If Model implements ChartEntryModel, and minX is not null, this overrides ChartEntryModel.minX.
-
getMaxX
abstract Float getMaxX()
The maximum value shown on the x-axis. If Model implements ChartEntryModel, and maxX is not null, this overrides ChartEntryModel.maxX.
-
setMaxX
abstract Unit setMaxX(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float maxX)
The maximum value shown on the x-axis. If Model implements ChartEntryModel, and maxX is not null, this overrides ChartEntryModel.maxX.
-
-
-
-