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

fix radar chart negative value rendering bug if startAtZeroEnabled is false for issue #166 #168

Closed
wants to merge 9 commits into from

Conversation

liuxuan30
Copy link
Member

For issue #166
we have to check if Double(yMin) / interval will be -1<x<0, if this is the case, ceil(x) would be 0. but I think we need it to be -1.

In order to render the negative values correctly,

 _yAxis.axisMinimum = _yAxis.entries[0];

is the key.

I have been thinking about different ways to fix. But I was suddenly realized the whole reason is the axisMinimum is not changed while the entries have been modified. Add this line solved my problem, and other radar charts remain good on my side. So I think this should be the correct way to fix it.

@danielgindi you must double check here, because I am not sure if you missed to set it, or you intend not to set _yAxis.axisMinimum.

@liuxuan30 liuxuan30 mentioned this pull request Jul 2, 2015
@danielgindi
Copy link
Collaborator

I still need to understand the different situations to see what you did here... Could you supply samples - before/after?

@liuxuan30
Copy link
Member Author

This is mainly about issue #166. Current logic for negative values has defect, especially for radar chart. Go to #166 to see all the details and the screenshot before and after.

You can try on your side, just turn off startAtZeroEnabled, and feed a nagative value. We need to use floor instead of ceil for negative values.

For radar chart, _yAxis.axisMinimum = _yAxis.entries[0]; is missing for correctly rendering negative values;

For commit: fix drawing out of bound negative value axis labels issue:
If the axis contains negative values, it will draw out of the bound; I have a screenshot in issue #166 as well.

For commit: drawExtras should also be included before restoring clipped context:
I think drawExtras should be included in the clipped context; otherwise it will render out of the chart.

@liuxuan30
Copy link
Member Author

I will close this since this mixed up some different issue here, though it is quite slight. I will use different branch for every change here.

@liuxuan30 liuxuan30 closed this Jul 13, 2015
@liuxuan30
Copy link
Member Author

OK, split done. see pull request #207, #208, #209

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

Successfully merging this pull request may close these issues.

2 participants