-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Line Chart do not draw line for Data Set #2567
Comments
Are you able to debug on your side... I can say nothing... |
@liuxuan30 thank you for your suggestion. Posted data sets are taken from LineChartDataSet graphDataSet instance on breakpoint right before calling And LineChartData instance chartData also contains LineChartDataSet graphDataSet with expected values: I will deeper investigate if:
And will come back with more data. Also I've experimented with ordering Data Sets by xValues and graph is redrawing perfectly with same code. But I need ChartDataEntries to be ordered as it is otherwise it is meaningless. If you can suggest any other ideas where to look I would be really helpful. |
OK, if you sure the data contains all your line data sets, when you debugging at Normally, it will read all your sets and render them. Giving the fact that in your first image it can render two lines already, I think the renderer should be fine. The problem is, the second time it tries drawing, the second line(red line) is missing, so you need to check does I reviewed your two data set samples, they are the same, except for the first one, which only has very small difference. Is there anything wrong on your side? If they are the same, why redraw again? BTW, you don't have to call |
@liuxuan30 once again thank you for replay.
I've noticed that in scope of debugging, thanks.
It is a process of dynamic recalculation and redrawing when User changes input value using slider.
I think I've found root of issue. For some reason in I'll investigate what causes that in |
@liuxuan30 so in scope of mine investigation it appears that And later was incorrectly used in What happened? Code in library works correctly only for ordered xValues because in this case So all code in
And it will cover case of not ordered xValues: Moreover |
one thing is missing that, how do you update your data? e.g. do you use |
This commit fixes an issue brought up in ChartsOrg#2567 (ChartsOrg#2567), where lines (and points) in LineCharts would not render correctly if the x-values were not in order.
@kbilyk how do you create a blue line in the chart?, could you give me the sample code?. I have to do a chart with polygon with coordinates like your polygon (blue line) but I can't find the solution about this issue. |
@jcamachov firs of all you need to replace content of function self.max = dataSet.entryCount - 1
range = dataSet.entryCount This change will allow you to pass not ordered by X data set and Charts will draw every point. Your data set should have first and last points with same coordinates in order to draw closed figure. Hope this will help with your issue. |
@kbilyk thank you for quick answer. What kind of chart must I use? LineChartView?, ScatterChartView?... I think that I use LineChartView but I can't change self.max and range in order to try that you say me in your answer. |
@jcamachov I've used
You'd, probably, should fork repo or make it local pod (as I did). |
@kbilyk : I changed XBounds.set() as you suggested, line chart is ok but I can not tap on it to highlight for some values. Do you have any solution? |
I'm running into a similar issue where I have a set of scatter chart data points, and the first data point isn't having it's custom icon rendered. Here is the issue I'm seeing
This loop in
It seems like the iterator for xBounds increments value to 1 before it is returned, so the This is for version |
Ahh I see this ☝️has been fixed in 3.3.0. 🎉 |
I need to update draw line chart to display result of calculations.
For some reason for data set:
Charts.LineChartDataSet, 13 entries: ChartDataEntry, x: 450.479217529297, y 7217.4140625 ChartDataEntry, x: 450.068511962891, y 7090.0 ChartDataEntry, x: 449.577758789062, y 6932.0 ChartDataEntry, x: 449.156005859375, y 6774.0 ChartDataEntry, x: 450.691955566406, y 6616.0 ChartDataEntry, x: 453.031677246094, y 6458.0 ChartDataEntry, x: 455.456634521484, y 6300.0 ChartDataEntry, x: 455.092803955078, y 6142.0 ChartDataEntry, x: 454.658813476562, y 5984.0 ChartDataEntry, x: 454.492492675781, y 5905.0 ChartDataEntry, x: 454.336486816406, y 5668.0 ChartDataEntry, x: 454.281585693359, y 5589.0 ChartDataEntry, x: 454.243194580078, y 5510.0
Line can be drawn:
And for data set:
Charts.LineChartDataSet, 13 entries: ChartDataEntry, x: 450.359344482422, y 7182.85095214844 ChartDataEntry, x: 450.068511962891, y 7090.0 ChartDataEntry, x: 449.577758789062, y 6932.0 ChartDataEntry, x: 449.156005859375, y 6774.0 ChartDataEntry, x: 450.691955566406, y 6616.0 ChartDataEntry, x: 453.031677246094, y 6458.0 ChartDataEntry, x: 455.456634521484, y 6300.0 ChartDataEntry, x: 455.092803955078, y 6142.0 ChartDataEntry, x: 454.658813476562, y 5984.0 ChartDataEntry, x: 454.492492675781, y 5905.0 ChartDataEntry, x: 454.336486816406, y 5668.0 ChartDataEntry, x: 454.281585693359, y 5589.0 ChartDataEntry, x: 454.243194580078, y 5510.0
It is no longer drawing:
The text was updated successfully, but these errors were encountered: