-
- All Implemented Interfaces:
-
com.patrykandpatrick.vico.core.chart.Chart,com.patrykandpatrick.vico.core.chart.insets.ChartInsetter,com.patrykandpatrick.vico.core.dimensions.BoundsAware
public final class ComposedChart<Model extends ChartEntryModel> extends BaseChart<ComposedChartEntryModel<Model>>
Combines multiple Charts and draws them on top of one another.
-
-
Field Summary
Fields Modifier and Type Field Description private final List<Chart<Model>>chartsprivate final TreeMap<Float, List<Marker.EntryModel>>entryLocationMapprivate final Collection<ChartInsetter>chartInsettersprivate FloatminYprivate FloatmaxYprivate FloatminXprivate FloatmaxXprivate final RectFboundsprivate AxisValuesOverrider<ComposedChartEntryModel<Model>>axisValuesOverrider
-
Constructor Summary
Constructors Constructor Description ComposedChart(Chart<Model> charts)ComposedChart(List<Chart<Model>> charts)
-
Method Summary
Modifier and Type Method Description final List<Chart<Model>>getCharts()The Charts that make up this ComposedChart. TreeMap<Float, List<Marker.EntryModel>>getEntryLocationMap()Links x-axis values to Marker.EntryModels. Collection<ChartInsetter>getChartInsetters()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. RectFgetBounds()The bounds of the abstract component. AxisValuesOverrider<ComposedChartEntryModel<Model>>getAxisValuesOverrider()Overrides the minimum and maximum x-axis and y-axis values. UnitsetAxisValuesOverrider(AxisValuesOverrider<ComposedChartEntryModel<Model>> axisValuesOverrider)Overrides the minimum and maximum x-axis and y-axis values. UnitsetBounds(Number left, Number top, Number right, Number bottom)HorizontalDimensionsgetHorizontalDimensions(MeasureContext context, ComposedChartEntryModel<Model> model)Called to get the HorizontalDimensions of this chart. UnitupdateChartValues(ChartValuesManager chartValuesManager, ComposedChartEntryModel<Model> model, Float xStep)Updates the ChartValues stored in the provided ChartValuesManager instance to this Chart’s ChartValues. UnitgetInsets(MeasureContext context, Insets outInsets, HorizontalDimensions horizontalDimensions)Called during the measurement phase, before getHorizontalInsets. UnitgetHorizontalInsets(MeasureContext context, Float availableHeight, HorizontalInsets outInsets)Called during the measurement phase, after getInsets. -
Methods inherited from class com.patrykandpatrick.vico.core.chart.composed.ComposedChart
addDecoration, addPersistentMarker, drawNonScrollableContent, drawScrollableContent, removeDecoration, removePersistentMarker, setDecorations, setPersistentMarkers -
Methods inherited from class com.patrykandpatrick.vico.core.chart.BaseChart
removeDecorations -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getEntryLocationMap
TreeMap<Float, List<Marker.EntryModel>> getEntryLocationMap()
Links x-axis values to Marker.EntryModels. A Marker.EntryModel holds the data needed to draw a Marker.
-
getChartInsetters
Collection<ChartInsetter> getChartInsetters()
-
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.
-
getAxisValuesOverrider
AxisValuesOverrider<ComposedChartEntryModel<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<ComposedChartEntryModel<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.
-
getHorizontalDimensions
HorizontalDimensions getHorizontalDimensions(MeasureContext context, ComposedChartEntryModel<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
Unit updateChartValues(ChartValuesManager chartValuesManager, ComposedChartEntryModel<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).
-
getInsets
Unit getInsets(MeasureContext context, Insets outInsets, HorizontalDimensions horizontalDimensions)
Called during the measurement phase, before getHorizontalInsets. Both horizontal and vertical insets can be requested from this function. The final inset for a given edge of the associated Chart is the largest of the insets requested for the edge.
- Parameters:
context- holds data used for the measuring of components.outInsets- used to store the requested insets.horizontalDimensions- the associated Chart’s HorizontalDimensions.
-
getHorizontalInsets
Unit getHorizontalInsets(MeasureContext context, Float availableHeight, HorizontalInsets outInsets)
Called during the measurement phase, after getInsets. Only horizontal insets can be requested from this function. Unless the available height is of interest, getInsets can be used to set all insets. The final inset for a given edge of the associated Chart is the largest of the insets requested for the edge.
- Parameters:
context- holds data used for the measuring of components.availableHeight- the available height.outInsets- used to store the requested insets.
-
-
-
-