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

add NaN check to allow non-digits handling for radar chart #152

Merged
merged 5 commits into from
Jun 19, 2015
Merged

add NaN check to allow non-digits handling for radar chart #152

merged 5 commits into from
Jun 19, 2015

Conversation

liuxuan30
Copy link
Member

The background is that not every data in every dataSet is valid number in real life.

add NaN check to allow non-digits handleing. if a CGPoint contains NaN, simply ignore it, this will ignore current point and continue the path with next valid point.

This is helpful, where dataSet 1 contains invalid data but dataSet 2 has valid data. People can have a chance to insert NaN if user found the data is nil/null/NSNotFound/ifinity/DOUBLE_MAX.... any number that cannot be drawn on screen or even exists in real life, and still get the chart.

for example,

xValues: [1,2,3,4,5]
dataSet 1: [5,6,NaN,8,9]
dataSet 2: [11,12,13,14,15]

With NaN support, the radar chart will connect dataSet 1 values: 5-6-8-9 as a web, and dataSet 2 as 11-12-13-14-15 as another web.

Attention:
I only add the code for radar chart, since I am more familiar with it and gives the demo. If it is a valid scenario, you can expand it to other charts accordingly.

…N, simply ignore it, this will ignore current point and continue the path with next valid point
@liuxuan30
Copy link
Member Author

radarnan

Check out the little white dot with yellow, its corresponding blue line has NaN so we don't have to highlight it and draw it.

@liuxuan30 liuxuan30 changed the title add NaN check to allow non-digits handling. add NaN check to allow non-digits handling for radar chart Jun 15, 2015
danielgindi added a commit that referenced this pull request Jun 19, 2015
Minor improvements to RadarChart
@danielgindi danielgindi merged commit 6190b08 into ChartsOrg:master Jun 19, 2015
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