CartesianChart

Host

The CartesianChartarrow-up-right host for views is CartesianChartViewarrow-up-right.

Creation

CartesianChartView automatically creates a CartesianChart when the layers attribute is used:

<style name="ChartStyle">
    <item name="layers"><!-- ... --></item>
    <!-- ... -->
</style>
<com.patrykandpatrick.vico.views.cartesian.CartesianChartView
    app:chartStyle="@style/ChartStyle"
    <!-- ... --> />

Use CartesianChartView.chartarrow-up-right property to get a reference to this CartesianChart. Also use it to apply a programmatically created CartesianChart:

cartesianChartView.chart = CartesianChart(/* ... */)

Scroll and zoom

There are XML attributes for toggling scroll and zoom:

<style name="ChartStyle">
    <item name="scrollEnabled">true</item>
    <item name="zoomEnabled">true</item>
    <!-- ... -->
</style>

More advanced customization is performed via ScrollHandlerarrow-up-right and ZoomHandlerarrow-up-right:

Last updated