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

Chart Line vanishes on pinch to zoom #63

Closed
caloon opened this issue May 2, 2015 · 10 comments
Closed

Chart Line vanishes on pinch to zoom #63

caloon opened this issue May 2, 2015 · 10 comments
Labels

Comments

@caloon
Copy link

caloon commented May 2, 2015

I experienced that when you zoom in on a chart using a pinch gesture, the chart lines are sometimes vanishing (no chart lines displayed). The data source however still contains several values.

Has anyone else experienced this issue?

@danielgindi
Copy link
Collaborator

Can you record what you are experiencing? (Using iPhone Simulator, iTunes or whatever...)

It could be theoretically lines that are skipped since being out of the viewport anyway, but that shouldn't happen. So maybe floats that are too big? (We're planning to move to Doubles anyway... #62 )

@caloon
Copy link
Author

caloon commented May 2, 2015

Yes, recorded the screen of my iPhone using QuickTime Player.
Find the video here: https://www.dropbox.com/s/kdxxqaauki6rcmo/LineChart%20vanishing.mov?dl=0

@danielgindi danielgindi added the bug label May 3, 2015
@danielgindi
Copy link
Collaborator

I can't make it happen the same way, it works flawlessly, except for one bug with Cubic lines which I'm fixing now.
Can you produce an example project?

@danielgindi
Copy link
Collaborator

Maybe try the latest fixes? I don't know if they affect you in some way, but it doesn't hurt to try!

@caloon
Copy link
Author

caloon commented May 4, 2015

I had the issue from the very first time I implemented it with my source data. A friend of mine (Testflight beta tests) reported the same issue.

Please find my sample data attached, maybe you can use it to reproduce the issue: http://www.codeshare.io/zdFG9

@caloon
Copy link
Author

caloon commented May 4, 2015

I just recognized that the xIndex of the ChartDataEntries is not unique (see line 191). Might this be the source of the error?

@caloon
Copy link
Author

caloon commented May 4, 2015

Just tested the above. Making the xIndex a unique integer seems to improve the situation somewhat, however the chart lines still vanish in certain time intervals.

By the way - would be good if xIndex could be a Float or Double, this would make it more flexible for relative values (currently my chart is an approximation of the next integer xIndex for a yVal).

@danielgindi
Copy link
Collaborator

A) I will test your code soon- it has nothing to do with the x indexes
B) x indexes shouldn't really be decimal as the distance between two
x-values should be equal. The values should be an approximation...

On Mon, May 4, 2015 at 10:31 PM, Josef notifications@github.com wrote:

Just tested the above. Making the xIndex a unique integer seems to improve
the situation somewhat, however the chart lines still vanish in certain
time intervals.

By the way - would be good if xIndex could be a Float or Double, this
would make it more flexible for relative values (currently my chart is an
approximation of the next integer value for a yVal).


Reply to this email directly or view it on GitHub
#63 (comment)
.

@danielgindi
Copy link
Collaborator

Well I can't test your code as I don't have the datasets and I sure am not
going to convert all those dates from println to NSDates :-)
Could you post a "working" sample project?

On Mon, May 4, 2015 at 10:32 PM, Daniel Cohen Gindi danielgindi@gmail.com
wrote:

A) I will test your code soon- it has nothing to do with the x indexes
B) x indexes shouldn't really be decimal as the distance between two
x-values should be equal. The values should be an approximation...

On Mon, May 4, 2015 at 10:31 PM, Josef notifications@github.com wrote:

Just tested the above. Making the xIndex a unique integer seems to
improve the situation somewhat, however the chart lines still vanish in
certain time intervals.

By the way - would be good if xIndex could be a Float or Double, this
would make it more flexible for relative values (currently my chart is an
approximation of the next integer value for a yVal).


Reply to this email directly or view it on GitHub
#63 (comment)
.

@caloon
Copy link
Author

caloon commented May 5, 2015

It seems as it is now solved: I applied the approximation to the yVals instead of the x indexes. The chart is now no longer vanishing.
Thanks for your help.

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

2 participants