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 LineComponent
s 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 LineComponent
s 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
columns
to apply a customLineComponent
list, use the following:columnCartesianLayer.columnProvider =
ColumnCartesianLayer.ColumnProvider.series(LineComponent(...), ...)In case your list is defined somewhere else, there’s also a
series
overload with aList<LineComponent>
parameter. (Here,columns
is your list, notColumnCartesianLayer#columns
.)columnCartesianLayer.columnProvider =
ColumnCartesianLayer.ColumnProvider.series(columns) -
If you’re using
map
withColumnCartesianLayer#columns
to customize the defaultLineComponent
s, either move this customization to XML, or create and customize yourLineComponent
s fully programmatically. -
If you’re reading the value of
columns
after updating it, save theLineComponent
list to a variable for later access:val columns = listOf(LineComponent(...), ...)
Apply the
LineComponent
list to theColumnCartesianLayer
like so:columnCartesianLayer.columnProvider =
ColumnCartesianLayer.ColumnProvider.series(columns)
Resolved bugs
- Data labels didn’t work in
ColumnCartesianLayer
s withMergeMode.Stacked
applied. Marker
s didn’t work for zero-height columns inColumnCartesianLayer
s.- The default
AxisItemPlacer.Horizontal
implementation could reduce the label spacing excessively when automatic label spacing was enabled.