-
- All Implemented Interfaces:
-
com.patrykandpatrick.vico.core.chart.Chart,com.patrykandpatrick.vico.core.chart.insets.ChartInsetter,com.patrykandpatrick.vico.core.dimensions.BoundsAware
public abstract class BaseChart<Model extends ChartEntryModel> implements Chart<Model>, BoundsAware
A base implementation of Chart.
-
-
Field Summary
Fields Modifier and Type Field Description private final RectFboundsprivate final Collection<ChartInsetter>chartInsettersprivate AxisValuesOverrider<Model>axisValuesOverriderprivate FloatminYprivate FloatmaxYprivate FloatminXprivate FloatmaxXprivate final Map<Float, List<Marker.EntryModel>>entryLocationMap
-
Constructor Summary
Constructors Constructor Description BaseChart()
-
Method Summary
Modifier and Type Method Description RectFgetBounds()The bounds of the abstract component. Collection<ChartInsetter>getChartInsetters()A Collection of the ChartInsetters that are part of this Chart. AxisValuesOverrider<Model>getAxisValuesOverrider()Overrides the minimum and maximum x-axis and y-axis values. UnitsetAxisValuesOverrider(AxisValuesOverrider<Model> axisValuesOverrider)Overrides the minimum and maximum x-axis and y-axis values. FloatgetMinY()The minimum value shown on the y-axis. UnitsetMinY(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float minY)The minimum value shown on the y-axis. FloatgetMaxY()The maximum value shown on the y-axis. UnitsetMaxY(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float maxY)The maximum value shown on the y-axis. FloatgetMinX()The minimum value shown on the x-axis. UnitsetMinX(@Deprecated(message = Axis values should be overridden via `Chart#axisValuesOverrider`., level = DeprecationLevel.ERROR) Float minX)The minimum value shown on the x-axis. FloatgetMaxX()The maximum value shown on the x-axis. 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 Map<Float, List<Marker.EntryModel>>getEntryLocationMap()Links x-axis values to Marker.EntryModels. BooleanaddDecoration(Decoration decoration)Adds a Decoration to this Chart. UnitsetDecorations(List<Decoration> decorations)Replaces the current list of decorations with the provided decorations. BooleanremoveDecoration(Decoration decoration)Removes a Decoration from this Chart. UnitaddPersistentMarker(Float x, Marker marker)Adds a persistent Marker to this Chart. UnitsetPersistentMarkers(Map<Float, Marker> markers)Replaces the current map of markers with the provided markers. UnitremovePersistentMarker(Float x)Removes a persistent Marker from this Chart. UnitdrawScrollableContent(ChartDrawContext context, Model model)Responsible for drawing the chart itself and any decorations behind it. UnitdrawNonScrollableContent(ChartDrawContext context, Model model)Responsible for drawing any decorations placed above the chart, as well as persistent markers. -
Methods inherited from class com.patrykandpatrick.vico.core.chart.BaseChart
getHorizontalDimensions, removeDecorations, updateChartValues -
Methods inherited from class com.patrykandpatrick.vico.core.chart.Chart
getHorizontalInsets, getInsets, setBounds -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getChartInsetters
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
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
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
Float getMinY()
The minimum value shown on the y-axis. If Model implements ChartEntryModel, and minY is not null, this overrides ChartEntryModel.minY.
-
setMinY
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
Float getMaxY()
The maximum value shown on the y-axis. If Model implements ChartEntryModel, and maxY is not null, this overrides ChartEntryModel.maxY.
-
setMaxY
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
Float getMinX()
The minimum value shown on the x-axis. If Model implements ChartEntryModel, and minX is not null, this overrides ChartEntryModel.minX.
-
setMinX
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
Float getMaxX()
The maximum value shown on the x-axis. If Model implements ChartEntryModel, and maxX is not null, this overrides ChartEntryModel.maxX.
-
setMaxX
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.
-
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.
-
addDecoration
Boolean addDecoration(Decoration decoration)
Adds a Decoration to this Chart.
-
setDecorations
Unit setDecorations(List<Decoration> decorations)
Replaces the current list of decorations with the provided decorations.
-
removeDecoration
Boolean removeDecoration(Decoration decoration)
Removes a Decoration from this Chart.
-
addPersistentMarker
Unit addPersistentMarker(Float x, Marker marker)
-
setPersistentMarkers
Unit setPersistentMarkers(Map<Float, Marker> markers)
Replaces the current map of markers with the provided markers.
-
removePersistentMarker
Unit removePersistentMarker(Float x)
-
drawScrollableContent
Unit drawScrollableContent(ChartDrawContext context, Model model)
Responsible for drawing the chart itself and any decorations behind it.
-
drawNonScrollableContent
Unit drawNonScrollableContent(ChartDrawContext context, Model model)
Responsible for drawing any decorations placed above the chart, as well as persistent markers.
-
-
-
-