Giter VIP home page Giter VIP logo

Comments (6)

patrickmichalik avatar patrickmichalik commented on August 25, 2024

Hello! Thanks for the report. The problem seems to be that, for a data set whose every y value is zero, ChartValues.minY and ChartValues.maxY are both zero by default. Their difference is zero, which leads to division by zero, and so things fall apart. We’ll update the logic such that the default y range is [0, 1] for such data. In the meantime, to fix the problem, you can use an AxisValuesOverrider implementation along these lines:

object : AxisValuesOverrider<ChartEntryModel> {
    override fun getMaxY(model: ChartEntryModel) = if (model.maxY != 0) model.maxY else 1f
}

For MergeMode.Stack, replace model.maxY with model.stackedPositiveY.

from vico.

alpriest avatar alpriest commented on August 25, 2024

Thanks, just dropped that in and it worked a treat 👍

from vico.

patrickmichalik avatar patrickmichalik commented on August 25, 2024

I’m glad to hear that. You’re welcome!

from vico.

patrickmichalik avatar patrickmichalik commented on August 25, 2024

Vico 2.0.0 Alpha 4 introduces the improvement mentioned above.

from vico.

patrickmichalik avatar patrickmichalik commented on August 25, 2024

This will be resolved in Vico 1 too—Vico 1.14.0 Alpha 1 includes the fix.

from vico.

patrickmichalik avatar patrickmichalik commented on August 25, 2024

Vico 1.14.0 is rolling out. Cheers!

from vico.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.