Vico

8.3. CartesianLayer

8.3.1. CandlestickCartesianLayer

To create a CandlestickCartesianLayer, use the XML attributes:

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

Alternatively, use the CandlestickCartesianLayer constructor:

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

8.3.2. ColumnCartesianLayer

To create a ColumnCartesianLayer, use the XML attributes:

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

Alternatively, use the ColumnCartesianLayer constructors:

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

8.3.3. LineCartesianLayer

To create a LineCartesianLayer, use the XML attributes:

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

Alternatively, use the LineCartesianLayer constructors:

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

8.3.4. Multiple CartesianLayers

You can add multiple CartesianLayers by separating their names with pipes:

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