patrykandpatrick / vico

A light and extensible chart library for Android.
https://patrykandpatrick.com/vico/wiki
Apache License 2.0
2.08k stars 125 forks source link

No axisValueOverrider in rememberCandlestickCartesianLayer #688

Closed zell-mbc closed 3 months ago

zell-mbc commented 4 months ago

How to reproduce

I am using the axisValueOverrider function to optimize real estate when displaying a chart. Basically not starting the y axis at 0 but rather at the data sets lowest value. This works fine for line charts and rememberLineCartesianLayer but it seems that feature is missing for rememberCandlestickCartesianLayer?

Observed behavior

No axisValueOverrider image

Expected behavior

The same axisValueOverrider as in rememberLineCartesianLayer image

Vico version(s)

Latest stable version

Android version(s)

Any

Additional information

Line chart example image

Same data as candle stick with the bottom part of the chart (60 and below) being empty space. image

Gowsky commented 4 months ago

Hello! Thank you for the report. We'll fix this problem in the next release. For the time being you can change the AxisValueOverrider after creating the CandlestickCartesianLayer instance, as the AxisValueOverrider is accessible as an instance property. For example:

rememberCandlestickCartesianLayer(/* some arguments */)
    .apply { axisValueOverrider = yourAxisValueOverrider }
zell-mbc commented 4 months ago

Worked right away, thanks for the quick turnaround.

Gowsky commented 4 months ago

Worked right away, thanks for the quick turnaround.

You're welcome!

patrickmichalik commented 3 months ago

Vico 2.0.0 Alpha 20 resolves this. Cheers!