I am using AnyChart
library for Android (library). I added one chart to the layout like this:
<com.anychart.AnyChartView
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
In fragment.kt
I set chart programmatically in this way:
binding.chart.setChart(chart1)
Everything works fine but I have a button to switch the chart to another and after changing I get the same chart. I use the same method as in initialization:
binding.chart.setChart(chart2)
Has anyone ever faced a similar problem? AnyChart doesn't allow to change the chart? (I have the same problem when I first set chart2
and then switch to chart1
so the problem isn't in chart
variable.)