2.0.0-alpha.13
This release introduces column-by-column customization for ColumnCartesianLayer and includes bug fixes.
| Breaking changes | Addressed |
|---|---|
| None | #471, #631, #635, #636 |
ColumnProvider
- Compose
- Views
In ColumnCartesianLayer, the new ColumnProvider API enables you to customize each column individually. You can implement the interface and override getColumn to return different LineComponents based on, for example, y value. ColumnProvider.series creates a ColumnProvider implementation with the series-based behavior from previous Vico versions. Follow the instructions in the deprecation messages to migrate to ColumnProvider.
In ColumnCartesianLayer, the new ColumnProvider API enables you to customize each column individually. You can implement the interface and override getColumn to return different LineComponents based on, for example, y value. ColumnProvider.series creates a ColumnProvider implementation with the series-based behavior from previous Vico versions. Follow the instructions in the deprecation messages to migrate to ColumnProvider.
The columnProvider property replaces columns. Migrate as follows:
-
If you’re using
columnsto apply a customLineComponentlist, use the following:columnCartesianLayer.columnProvider =
ColumnCartesianLayer.ColumnProvider.series(LineComponent(...), ...)In case your list is defined somewhere else, there’s also a
seriesoverload with aList<LineComponent>parameter. (Here,columnsis your list, notColumnCartesianLayer#columns.)columnCartesianLayer.columnProvider =
ColumnCartesianLayer.ColumnProvider.series(columns) -
If you’re using
mapwithColumnCartesianLayer#columnsto customize the defaultLineComponents, either move this customization to XML, or create and customize yourLineComponents fully programmatically. -
If you’re reading the value of
columnsafter updating it, save theLineComponentlist to a variable for later access:val columns = listOf(LineComponent(...), ...)Apply the
LineComponentlist to theColumnCartesianLayerlike so:columnCartesianLayer.columnProvider =
ColumnCartesianLayer.ColumnProvider.series(columns)
Resolved bugs
- Data labels didn’t work in
ColumnCartesianLayers withMergeMode.Stackedapplied. Markers didn’t work for zero-height columns inColumnCartesianLayers.- The default
AxisItemPlacer.Horizontalimplementation could reduce the label spacing excessively when automatic label spacing was enabled.