Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BarChart crashing when changing data on runtime #309

Open
PavlosTze opened this issue Dec 22, 2021 · 1 comment
Open

BarChart crashing when changing data on runtime #309

PavlosTze opened this issue Dec 22, 2021 · 1 comment

Comments

@PavlosTze
Copy link

The BarChart crashes when changing the data on runtime (if the number of datapoints is changed). This is because of the following code:
On BarChartView.kt:
` if (barsColorsList == null)
barsColorsList = List(frames.size) { barsColor }.toList()

        if (barsColorsList!!.size != frames.size)
            throw IllegalArgumentException("Colors provided do not match the number of datapoints.")`

If someone tries to change the data on runtime, by clicking a filter button for example, the frames.size is changed, but the barsColorsList!!.size isn't, because of the above code only checks for nullability so it doesn't update the barsColorsList.

Will submit a PR to fix this.

@PavlosTze
Copy link
Author

@diogobernardino Just created a PR to fix this issue:
#310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant