-
Notifications
You must be signed in to change notification settings - Fork 799
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
kotlin.UninitializedPropertyAccessException: lateinit property chartConfiguration has not been initialized #283
Comments
I've done that as a workaround in my fragment (for DonutChartView). How it works? The chartConfiguration lateinit property of ChartRenderer is initialized in show() and animate() methods of DonutChartView, so you have to invoke one of these methods before View's onDraw(), because chartConfiguration is accessed in onDraw().
|
@swistak7171 Unfortunately this solution doesn't work for charts in recyclerview. I'm doing the following as workaround: In my custom rv item view that includes chart as child, I override the following methods:
This resolves the issue @diogobernardino any comment from your side would be great! |
I couldn't yet reproduce it. Can someone provide a bit more context (e.g. data, rv adapter, rv view holder)? |
I have the same problem as @swistak7171 @ugurcany, but I am using the DonutChartView. |
@diogobernardino,
Error
|
Having a second look at the exceptions, my guess is that the |
Same Issue using DonutChartView with data binding.
Data binding:
|
Same issue. Using chart inside onViewCreated/onResume of the viewPager fragment. Lateinit property innerFrame has not been initialized. The chart is drawn blank despite getting the data populated. Trying to click a blank chart results in a crash. Clearly a library issue not initializing properly. And using lateinit was a bad idea to begin with. |
I faced the same exception on Andorid11 with LineChart. I share this proj (https://github.com/vicpls/WChart) and Log.txt |
i think it happen because the graph is init in hurry time. i solved it by give some delay
|
I'm using
LineChartView
in a custom view, and using that custom view in an item view of aRecyclerView
. Each rv item has a different number of entries set usingshow(...)
inonBindViewHolder(...)
as expected. However, when I scroll down, I get the following error and app crashes:Running device: Pixel 4 emulator, Android API 30
The text was updated successfully, but these errors were encountered: