Releases: patrykandpatrick/vico
v2.1.0-alpha.4
Overview
- breaking changes: none
- addressed: #1011
multiplatform
- An issue where
CartesianChart
mispositionedLegend
s has been resolved.
v2.1.0-alpha.3
Overview
compose
- In noninteractive Compose previews—which don’t support asynchronous execution—
CartesianChartHost
now handlesCartesianChartModelProducer
communication synchronously, enabling charts to display as expected. For this to work, the consumer must also move processing to the main thread—for example, by callingrunTransaction
fromrunBlocking
rather thanLaunchedEffect
. This should be done only for previews.
multiplatform
- In noninteractive Compose previews—which don’t support asynchronous execution—
CartesianChartHost
now handlesCartesianChartModelProducer
communication synchronously, enabling charts to display as expected. For this to work, the consumer must also move processing to the main thread—for example, by callingrunTransaction
fromrunBlocking
rather thanLaunchedEffect
. This should be done only for previews. - An incorrect package declaration has been amended;
CartesianLayerRangeProvider
is now incom.patrykandpatrick.vico.multiplatform.cartesian.data
. - The sample app has been made multiplatform. In this initial version, there are three multiplatform sample charts. However, multiplatform versions of all remaining sample charts will be introduced in upcoming updates. This process will be complete by the time Vico
2.1.0
is published.
-
Excluding
multiplatform
, which is experimental. (It will remain available, but the API is subject to change.) ↩
v2.1.0-alpha.2
Overview
- breaking changes: none
- addressed: #353
multiplatform
This new module provides Compose Multiplatform support. The currently supported platforms are Android and iOS, but this will be expanded. multiplatform
is standalone; to use it, add only the following Vico dependency:
[versions]
vico = "2.1.0-alpha.2"
# ...
[libraries]
vico = { group = "com.patrykandpatrick.vico", name = "multiplatform", version.ref = "vico" }
# ...
The multiplatform
API closely resembles that of compose
. There are some minor differences in feature set:
compose-m3
andcompose-m2
equivalents aren’t available yet. You can replicate their functionality by creating your ownMaterialTheme
-basedVicoTheme
.- A
ComponentShader
equivalent isn’t available yet. You can useShaderBrush
instead. ShapeComponent
doesn’t support shadows yet. This is due to Compose Multiplatform’sPaint
lacking shadow functionality.
A Compose Multiplatform sample app and multiplatform
coverage in the guide are being worked on and will be available by the time Vico 2.1.0
is published. However, with the similarity of compose
and multiplatform
, most of the compose
documentation applies, and you can fill in the gaps by referring to the multiplatform
API reference.
multiplatform
is experimental; it will remain available, but the API is subject to change. While multiplatform
is Jetpack Compose–compatible, compose
support continues. In the distant future, compose
will be removed in favor of multiplatform
, which will then be renamed to compose
.
v2.1.0-alpha.1
Warning
The old, pre-1.6.2
Maven Central coordinates are being discontinued. Those using them will receive deprecation warnings.
Overview
- breaking changes: none
- external contributors: @L-Andrade
core
DefaultCartesianMarker.LabelPosition.BelowPoint
has been introduced. This positions the label below the bottommost marked point.- The default dash and gap lengths for
LineCartesianLayer.LineStroke.Dashed
have been updated.
v1.16.1
v2.0.1
Overview
- breaking changes: none
- addressed: #993
compose
- An issue where the logical display density was obtained from
Context
instead ofLocalDensity
for sp-to-px conversion has been addressed. This problem causedLocalDensity
-based overrides to have no effect on text scaling inCartesianChart
s.
v2.0.0
This release is effectively identical to version 2.0.0-beta.7
. The following compares versions 2.0.0
and 1.16.0
.
Overview
- breaking changes: major
- addressed: #259, #265, #295, #296, #317, #349, #352, #384, #405, #413, #427, #430, #450, #469, #471, #481, #482, #483, #489, #496, #499, #535, #553, #563, #574, #585, #589, #602, #620, #623, #636, #652, #701, #713, #722, #736, #776, #785, #794, #824, #939
- external contributors: @anshu7vyas, @cristianboicu01, @L-Andrade, @MessiasLima, @Tyler-Lopez
Highlights
Vico 2.0.0 is the result of a sweeping redesign of the library. The key changes are highlighted below.
-
The overhauled API has a streamlined, consolidated structure—offering greater flexibility in a smaller footprint. Most notably, there’s now a single pair of chart-drawing and model-producing classes for both single- and multi-layer charts.
-
Candlestick charts have been introduced, with comprehensive candle customization and presets for filled and hollow candles.
-
Line charts now support dashed lines.
-
The new line-styling framework for line charts facilitates the creation of data-aware line and area fills, including color scales. It offers presets for single and double fills. In the latter, two separate styles are used—one above a given y value and one below it. A common use case is applying different colors for positive and negative y-values.
-
The reworked scroll and zoom systems offer precise control—with features that facilitate scrolling by a given number of x units, scrolling to a given x coordinate, setting the viewport width in x units, and more.
-
The new provider interfaces enable granular customization of chart layers. Key use cases include styling columns based on their y-values and displaying points only for selected entries in line charts.
-
With intelligent default y-ranges and y-axis label positioning, y-axes are more legible by default. First, a suitable power of 10 is inferred. Then, the y-range bounds are rounded outward to a multiple thereof, and labels are positioned at multiples of this power of 10.
-
With the new and improved built-in axis-item placers, x-axes can dynamically adjust their item spacing based on the zoom factor, preventing label truncation. There’s also a built-in step-based item placer for y-axes.
-
The redesigned marker framework provides more detailed information on the marked points, simplifying value formatting and facilitating the implementation of context-aware behavior. Thanks to these improvements, the built-in marker’s default formatter now intelligently determines when to sum values and when to only list them individually.
-
The expanded extra framework enables model-synchronized updates in multiple new areas.
-
Series values are now stored using
Double
instead ofFloat
, eliminating the need for most range- and precision-reducing transformations, especially for Unix timestamps. -
The new, more powerful cache mechanism boosts drawing performance. It retains far more reusable data between frames and, in addition, can share it between multiple instances of the same component.
-
For Jetpack Compose, stability-related enhancements have been made, facilitating composable skipping and thus improving performance.
-
The new defaults offer a refreshed, more versatile appearance out of the box.
-
The expanded, reorganized documentation provides more comprehensive guidance. The sample app has been restructured for clarity, and the all-new sample charts visualize real-world data, making them a more practical reference. Enhancements will continue to be made in these areas.
Thank you for your valuable feedback, which helped shape Vico 2.0.0.
Next steps
- Read the guide.
- Explore the sample app.
- Consult the API reference.
- Ask a question to get migration help.
Vico 1 support
Bug reports for Vico 1 will be accepted until January 31, 2026. Bug fixes will be provided until February 28, 2026.
v2.0.0-beta.7
Overview
- breaking changes: minor
core
- In
CacheStore
, the constructor andpurge
have been hidden. These aren’t intended for consumer access; useMeasuringContext.cacheStore
.
compose
- An issue where the
CacheStore
was recreated onCartesianChartModel
updates—impeding performance, particularly forLineCartesianLayer
—has been resolved.
v2.0.0-beta.6
Overview
- breaking changes: minor
core
LineCartesianLayer.PointConnector.Sharp
, which uses line segments, has been introduced.LineCartesianLayer.PointConnector.cubic
thus no longer permits settingcurvature
to zero.- Some defaults have been updated:
- The default color palette has been refreshed.
- In
ColumnCartesianLayer
, columns now have sharp corners by default. - In
LineCartesianLayer
, lines are now sharp by default. Also,Line.areaFill
is set tonull
. To recreate the previous defaultLineCartesianLayer.AreaFill
, useLineCartesianLayer.AreaFill.single
orLineCartesianLayer.AreaFill.double
andShaderProvider.verticalGradient
.
compose
- The defaults have been updated in accordance with
core
change 2. The color palettes produced byrememberM2MaterialTheme
andrememberM3MaterialTheme
remain unchanged. rememberLayeredComponent
has been removed; use theLayeredComponent
constructor.
views
- An issue where the
verticalAxisVerticalLabelPosition
XML attribute of theAxisStyle
attribute set was misinterpreted has been resolved. - The defaults have been updated in accordance with change 2. In connection with this, the
gradientTopColor
,gradientBottomColor
,positiveGradientTopColor
,positiveGradientBottomColor
,negativeGradientTopColor
, andnegativeGradientBottomColor
XML attributes of theLineStyle
attribute set have been removed. For a gradientLineCartesianLayer.AreaFill
, useAreaFill.single
orAreaFill.double
andShaderProvider.verticalGradient
.
v2.0.0-beta.5
Overview
- breaking changes: moderate
- addressed: #933
core
- Concurrency-related fixes have been made to
CartesianChartModelProducer
, resolving an issue where running twoTransaction
s in very short succession could cause a lock-up. Also,createTransaction
, theTransaction
constructor, andTransaction.commit
have been hidden or removed—userunTransaction
. Dimensions
has been renamed toInsets
. TheEmpty
singleton is now calledZero
.- In
AutoScrollCondition
,shouldPerformAutoScroll
is nowshouldScroll
, the function parameters have been flipped, andOnModelSizeIncreased
is nowOnModelGrowth
. - In
FadingEdges
,startEdgeWidthDp
is nowstartWidthDp
,endEdgeWidthDp
isendWidthDp
, andedgeWidthDp
iswidthDp
. Zoom.static
has been renamed toZoom.fixed
.- In
Shadow
,dxDp
anddyDp
are nowxDp
andyDp
. - In
CandlestickCartesianLayerModel
,Entry.Change
is nowChange
. - In
CandlestickCartesianLayer
, the name ofcandles
has been corrected tocandleProvider
. - In
BaseAxis.Size.Auto
,minSizeDp
andmaxSizeDp
are nowminDp
andmaxDp
.BaseAxis.Size.Exact
has been renamed toBaseAxis.Size.Fixed
, and itssizeDp
constructor parameter is now calledvalueDp
. - In
LayeredComponent
,rear
is nowback
. HorizontalPosition
andVerticalPosition
are nowPosition.Horizontal
andPosition.Vertical
.CartesianMarkerValueFormatter
is nowDefaultCartesianMarker.ValueFormatter
.DefaultCartesianMarker.ValueFormatter.default
replacesDefaultCartesianMarkerValueFormatter
. If subclassingDefaultCartesianMarkerValueFormatter
, switch to a delegation-based solution, or make the custom implementation standalone.DynamicShader
is nowShaderProvider
. InShaderProvider.component
,tileXMode
andtileYMode
are nowxTileMode
andyTileMode
.Shader.toDynamicShader
is nowShader.toShaderProvider
. TheRectF
-basedgetShader
overload has been removed in favor of the four-parameter one. InFill
,shader
is nowshaderProvider
.- In
VerticalAxis
,verticalLabelPosition
is now of typePosition.Vertical
. The same applies to theverticalLabelPosition
parameters ofstart
andend
.VerticalAxis.VerticalLabelPosition
has been removed. - In
ColumnCartesianLayer
andLineCartesianLayer.Line
,dataLabelVerticalPosition
is nowdataLabelPosition
. - The
CorneredShape
API has been consolidated:Corner
is nowCorneredShape.Corner
. InRelative
,percentage
is nowsizePercent
. In both subclasses,cornerTreatment
is nowtreatment
.FullyRounded
is nowRounded
.CornerLocation
is nowCorneredShape.CornerPosition
.CornerTreatment
is nowCorneredShape.CornerTreatment
. IncreateCorner
, the parameters have been reordered, andcornerLocation
is nowposition
.SharpCornerTreatment
,RoundedCornerTreatment
, andCutCornerTreatment
have been hidden or removed in favor ofCorneredShape.CornerTreatment.Sharp
,CorneredShape.CornerTreatment.Rounded
, andCorneredShape.CornerTreatment.Cut
.
- In the
CorneredShape
-basedMarkerCorneredShape
constructor,corneredShape
has been renamed tobase
. - A public
Point
constructor has been introduced, replacing thepoint
factory functions. HorizontalDimensions
is nowCartesianLayerDimensions
, andMutableHorizontalDimensions
isMutableCartesianLayerDimensions
. InAxis
,updateHorizontalDimensions
is now calledupdateLayerDimensions
, and thehorizontalDimensions
parameter has been renamed tolayerDimensions
. InCartesianLayer
,updateHorizontalDimensions
has been renamed toupdateDimensions
, and thehorizontalDimensions
parameter has been renamed todimensions
. Beyond this, thehorizontalDimensions
properties and parameters have been renamed tolayerDimensions
.Insets
-related changes have been made:Insets
is nowCartesianLayerMargins
, andHorizontalInsets
isHorizontalCartesianLayerMargins
.CartesianLayerInsetter
is now calledCartesianLayerMarginUpdater
. TheupdateInsets
function is nowupdateLayerMargins
, and itsinsets
parameter is nowlayerMargins
. TheupdateHorizontalInsets
function is nowupdateHorizontalLayerMargins
, and itsinsets
parameter is nowhorizontalLayerMargins
. In both functions,horizontalDimensions
is nowlayerDimensions
, and the parameters have been reordered.- In
HorizontalAxis.ItemPlacer
,getStartHorizontalAxisInset
is nowgetStartLayerMargin
, andgetEndHorizontalAxisInset
isgetEndLayerMargin
. InVerticalAxis.ItemPlacer
,getTopVerticalAxisInset
is nowgetTopLayerMargin
, andgetBottomVerticalAxisInset
isgetBottomLayerMargin
.
- In the
LegendItem
functions, the parameters have been reordered, andiconPaddingDp
is nowiconLabelSpacingDp
. - In
Bounded
, theRectF
-basedsetBounds
overload has been removed in favor of the four-parameter one. - In
DrawingContext
,withOtherCanvas
is nowwithCanvas
. - In
MeasuringContext
,layoutDirectionMultiplier
is now of typeInt
. - In
CartesianLayer
,updateRanges
is nowupdateChartRanges
, and theranges
parameter has been renamed tochartRanges
. - In the
drawHorizontal
function ofLineComponent
,centerY
is nowy
. IndrawVertical
,centerX
isx
, and the parameters have been reordered. In both functions,thicknessScale
is nowthicknessFactor
. - The properties of
CartesianLayerPadding
are now public. - Some nonessential API elements have been hidden or removed.
compose
- In conneciton with
core
change 2, thedimensions
factory function is nowinsets
, and allDimensions
parameters are now of typeInsets
. - In connection with
core
change 4, thestartEdgeWidth
,endEdgeWidth
, andwidth
parameters of therememberFadingEdges
overloads are nowstartWidth
,endWidth
, andwidth
. - In connection with
core
change 6, thedx
anddy
parameters ofshadow
have been renamed tox
andy
. - In connection with
core
change 8, thecandles
parameter ofrememberCandlestickCartesianLayer
has been renamed tocandleProvider
. - In connection with
core
change 9, theminSize
andmaxSize
parameters ofBaseAxis.Size.auto
are now calledmin
andmax
,BaseAxis.Size.exact
has been renamed toBaseAxis.Size.fixed
, and itssize
parameter is now calledvalue
. - In connection with
core
change 10, therear
parameter ofrememberLayeredComponent
has been renamed toback
. - In connection with
core
change 14, inVerticalAxis.rememberStart
andVerticalAxis.rememberEnd
,verticalLabelPosition
is now of typePosition.Vertical
. - In connection with
core
change 15, inrememberColumnCartesianLayer
andLineCartesianLayer.rememberLine
,dataLabelVerticalPosition
is nowdataLabelPosition
. - In connection with
core
change 17, in theCorneredShape
-basedmarkerCorneredShape
overload,corneredShape
has been renamed tobase
. - In
markerCorneredShape
, the name oftickSizeDp
has been corrected totickSize
. rememberExtraLambda
has been removed, as with Jetpack Compose’s strong skipping mode, it’s no longer needed. Use normal lambdas instead.- In
CartesianChartHost
,runInitialAnimation
is nowanimateIn
.
views
- In connection with
core
change 15, thedataLabelVerticalPosition
XML attributes have been renamed todataLabelPosition
. - In
ScrollHandler
, theanimateScroll
parameters have been reordered, theoldValue
andnewValue
parameters ofListener.onValueChanged
have been renamed toold
andnew
, and theoldMaxValue
andnewMaxValue
parameters ofListener.onMaxValueChanged
have been renamed toold
andnew
. - In
ChartView
,runInitialAnimation
is nowanimateIn
. - In
ZoomHandler.Listener
, theoldValue
andnewValue
parameters ofonValueChanged
have been renamed toold
andnew
, and theoldValueRange
andnewValueRange
parameters ofonValueRangeChanged
have been renamed toold
andnew
.