Closed x0m3g4 closed 2 years ago
I was able to sort this out by creating the alternative data set along with "chartData":
val chartData1: ChartData = ChartLogicClass().getChart1Data() val chartData2: ChartData = ChartLogicClass().getChart2Data()
And later assigned data to the charts based on "chartCondition" (in my case, during onClick event)
val chartData = if (chartCondition=="Chart1") { chartData1 } else { chartData2 } APIlib.getInstance().setActiveAnyChartView(charts.chart1) chart1.data(chartData.chart1data) APIlib.getInstance().setActiveAnyChartView(charts.chart2) chart2.data(chartData.chart2data) APIlib.getInstance().setActiveAnyChartView(charts.chart3) chart3.data(chartData.chart3data)
I'm trying to update 3 charts on an on-click event, however, the charts are not refreshing the data until the application is restarted.
Update function running inside a Coroutine (data comes from Firestore) :
Data class:
Is there anything I'm missing here? the initial data populates just fine, but the updates I can't seem to quite get.