Skip to content

[BUG] No lines drawn on chart if all the y coordinates are the same value #46

@odvratnozgodan

Description

@odvratnozgodan

Describe the bug
If the Dataset contains data that doesn't vary the y coordinate the chart doesn't draw anything. Looking at the source code of the library it's probably caused because the lowerBound and upperBound for the Dataset both are the same value and the LiveChartView subtracts those values(result is zero) and then uses that value for various division and multiplication. The problem persists even if a second dataset is passed to the LiveChart with .setSecondDataset() method.

To Reproduce
Steps to reproduce the behavior:

  1. Create a dataset with all points having the same y coordinates
  2. pass the dataset as the argument to liveChart.setDataset()
  3. Call liveChart.drawDataset()
  4. See error

Expected behavior
The chart should display a line at the bottom of the chart.

Smartphone (please complete the following information):

  • Device: Google Pixel 5
  • OS: Android 12
  • Version [e.g. 1.3.6]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions