core
CartesianChart
CartesianChartModelProducer
CartesianLayer
CandlestickCartesianLayer
ColumnCartesianLayer
LineCartesianLayer
Axis
CartesianValueFormatter
CartesianMarker
Decoration
Component
Fill
Shape
Legend
compose
VicoTheme
views
<style name="ChartStyle"> <item name="layers">column</item> <item name="showBottomAxis">true</item> <item name="showStartAxis">true</item> </style>
<com.patrykandpatrick.vico.views.cartesian.CartesianChartView android:id="@+id/cartesian_chart_view" android:layout_width="match_parent" android:layout_height="wrap_content" app:chartStyle="@style/ChartStyle" />
At the top level of the Activity:
Activity
val modelProducer = CartesianChartModelProducer()
In onCreate:
onCreate
cartesianChartView.modelProducer = modelProducer lifecycleScope.launch { modelProducer.runTransaction { columnSeries { series(4, 12, 8, 16) } } }
<style name="ChartStyle"> <item name="layers">line</item> <item name="showBottomAxis">true</item> <item name="showStartAxis">true</item> </style>
cartesianChartView.modelProducer = modelProducer lifecycleScope.launch { modelProducer.runTransaction { lineSeries { series(4, 12, 8, 16) } } }
Refer to the sample app—see “Sample app” under “Learning resources” in the preface.