Skip to content
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

drawCubicEnabled on LineChartView is missing points when Y Values are missing #157

Closed
louis49 opened this issue Jun 17, 2015 · 5 comments
Closed
Labels

Comments

@louis49
Copy link

louis49 commented Jun 17, 2015

With this data you can reproduce the bug :

    var xVals:[String] = ["0", "1", "2", "3", "4", "5", "6"]
    var yVals:[ChartDataEntry] = [
        ChartDataEntry(value: Double(1), xIndex: 1),
        ChartDataEntry(value: Double(5), xIndex: 3),
        ChartDataEntry(value: Double(3), xIndex: 5)
    ]

    var dataSet:LineChartDataSet = LineChartDataSet(yVals: yVals)
    dataSet.drawCirclesEnabled = false
    dataSet.drawFilledEnabled = true
    dataSet.drawCubicEnabled = true

    var data:LineChartData = LineChartData(xVals: xVals, dataSet: dataSet)

ios simulator screen shot 18 juin 2015 11 54 52

@danielgindi
Copy link
Collaborator

It looks like there's not enough data to complete a cubic curve. We can of course simulate the last coordinate, and we've done that in the past, so this is a bug introduced lately I guess.
Can you confirm that it works when adding another point?

@louis49
Copy link
Author

louis49 commented Jun 26, 2015

Yes it works when adding all points

@danielgindi
Copy link
Collaborator

I've looked into this - and the problem is the missing y values, which the renderer is not aware of.
@PhilJay do you think that just looping back on the prev point and looping forward on the next point until we have enough points - is enough to solve this? I know that there are some issues on Android with path sizes and a point could be found futher away on the chart and resulting in a bigger path...

@danielgindi danielgindi changed the title LineChartView - use of drawFilledEnabled with drawCubicEnabled and LineChartDataSet draw anormal chart drawCubicEnabled on LineChartView is missing points when Y Values are missing Jun 29, 2015
@PhilJay
Copy link
Collaborator

PhilJay commented Jun 29, 2015

Yes that could be a solution.
The issue concerning the path only arises if they are significantly larger (in terms of covered pixels) than the screen size.
I think that there still might be some issues in our implementation that cause the "path too big" problem.

@danielgindi
Copy link
Collaborator

This was solved in a recent commit, last week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants