Closed Dimas-Saputra-Me closed 9 months ago
Hello! It looks like you’re using the wrong lineChart
function. The version with a context
parameter comes from the views
module and shouldn’t be used with Jetpack Compose. Please import and use the composable lineChart
function instead.
As such, even though you’re using the wrong function, a crash likely shouldn’t occur here. We’ll look into it. Regardless, switching to the composable function is recommended and should resolve the problem. I’d also like to mention that there’s no longer such a naming clash in Vico 2.
Ah yea I imported the wrong lineChart
function. Thanks, it works now. I'll mark it as resolved 👍
Thank you very much
I’m glad that helped. You’re welcome!
How to reproduce
I'm Using vico 1.13.1 Version and also used Compose as my view style implementation So I was following to use custom axes from the docs, so here is my code somewhat look like. (Is there anything wrong with my code? )
It does fine at first, untill I add some of things sort like textfield, dropdowns, etc that trigger compose recomposition. Like this for the example
Whenever I typed in the textfield / trigger recomposition the error cames and crashes the application (This is some of the error code)
Observed behavior
So here is what I've tried so far
Changing the model using a simple model (Doesn't works)
val chartEntryModel = entryModelOf(4f, 12f, 8f, 16f)
Trying to remove my element that trigger recomposition (works)
I removed some of my dropdowns and textfield
Changing chart type into columnChart() (Works) Idk why
lineChart()
does require context as argument butcolumnChart()
doesn't?So that's why I came into the conclusion
columnChart()
doesn't need context as their argument)Expected behavior
Thanks in Advance ✨
Vico version(s)
Latest stable version
Android version(s)
11
Additional information
No response