You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm migrating from 2.2.4 to 3.0.0 and am having issues adding xValues (strings in my case) to the chartData object. Previously I was able to do:
// yData: [Double]
// xData: [String]
// Adds in y-value entries to the dataset
for i in 0..<ydata.count {
let dataEntry = ChartDataEntry(value: ydata[i], xIndex: i)
self.lineChartDataSet!.addEntry(dataEntry)
}
// Adds dataset to the ChartData object
self.lineChartData!.addDataSet(self.lineChartDataSet)
// Adds in string x-values for corresponding indices
for i in 0..<xdata.count {
self.lineChartData!.addXValue(xdata[i])
}
It seems like the process for adding in xValues has changed (which is my case are date strings, like "Jan 20").
I've scoured the documentation and release notes and have been banging my head on this for awhile. Does anyone have any guidance for how to implement this in 3.0.0?
Thanks very much!
The text was updated successfully, but these errors were encountered:
Note that if you have a chart that needs to dynamically redraw a new set of points (and corresponding string x-values), calling notifyDataSetChanged on the ChartView no longer worked for me.
Instead, before supplying the new data I explicitly call lineChartView.clearValues() and this seems to work. I suspect there's a performance penalty but if there is, it's not noticeable for my use case.
Hello,
I'm migrating from 2.2.4 to 3.0.0 and am having issues adding xValues (strings in my case) to the chartData object. Previously I was able to do:
It seems like the process for adding in xValues has changed (which is my case are date strings, like "Jan 20").
I've scoured the documentation and release notes and have been banging my head on this for awhile. Does anyone have any guidance for how to implement this in 3.0.0?
Thanks very much!
The text was updated successfully, but these errors were encountered: