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 not sure if this is a bug or intended behavior, but it wasn't intuitive for me at least. Suppose you have the following array of eight ChartDataEntries, which is just entries from 0 to 9 but missing values for xIndex = 3 and 6:
The data is missing values for xIndex = 3 and 6. If my xVals array matches that set of ChartDataEntries exactly:
let xVals = ["0", "1", "2", "4", "5", "7", "8", "9"]
let data = LineChartData(xVals: xVals, dataSet: dataSet)
chartView.data = data
Then the chart comes out showing only six values which are misaligned:
On the other hand, if my xVals array purposely includes the missing two xIndex values:
let xVals = ["0", "1", "2", "3", 4", "5", "6", "7", "8", "9"]
let data = LineChartData(xVals: xVals, dataSet: dataSet)
chartView.data = data
Then the chart comes out the way I expect it to, with eight values properly aligned:
My question is, is this a bug or intended functionality? I would expect these two graphs to match. In the first case, I would expect that the graph would be able to interpolate the gaps between the labels (and just leave them blank, if necessary). Even though the xVals array of labels alone doesn't inform where the gaps should go, the data set shows where the gaps are.
The text was updated successfully, but these errors were encountered:
UberJason
changed the title
LineChartData misaligns values when data isn't continuous
LineChartData omits and misaligns values when data isn't continuous
Feb 1, 2016
Is this documented somewhere that I've missed it? Personally I find that very unintuitive. Why is it designed this way? Now when you have a data set with missing data, you have to go through and find and manually include the intermediate x-values for that missing data.
In old issues, while talking about nil value. I think it's not intuitive, but designing like this would have less issues. The idea is, the distance between 2 index on x axis is equal, based on index. Because the line chart does not know how you want to ignore it. Using index is straightforward.
Hi,
I'm not sure if this is a bug or intended behavior, but it wasn't intuitive for me at least. Suppose you have the following array of eight ChartDataEntries, which is just entries from 0 to 9 but missing values for xIndex = 3 and 6:
The data is missing values for xIndex = 3 and 6. If my xVals array matches that set of ChartDataEntries exactly:
Then the chart comes out showing only six values which are misaligned:
On the other hand, if my xVals array purposely includes the missing two xIndex values:
Then the chart comes out the way I expect it to, with eight values properly aligned:
My question is, is this a bug or intended functionality? I would expect these two graphs to match. In the first case, I would expect that the graph would be able to interpolate the gaps between the labels (and just leave them blank, if necessary). Even though the xVals array of labels alone doesn't inform where the gaps should go, the data set shows where the gaps are.
The text was updated successfully, but these errors were encountered: