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

How can i add null values to my chart? #1273

Closed
rashidasgari opened this issue Jul 27, 2016 · 4 comments
Closed

How can i add null values to my chart? #1273

rashidasgari opened this issue Jul 27, 2016 · 4 comments

Comments

@rashidasgari
Copy link

rashidasgari commented Jul 27, 2016

I was wondering if there is a way to add null values to two chart. Meaning i want to have gaps in my chart. I have LineChart with two data sets. Something like this
photo_2016-07-27_23-46-11

@liuxuan30
Copy link
Member

Line breaking feature is not supported yet, but you could use two data sets to simulate the gap.
To add null, just create the xIndex but not insert any entry for that xIndex

@rashidasgari
Copy link
Author

rashidasgari commented Jul 28, 2016

[value addObject:[[ChartDataEntry alloc] initWithValue:val xIndex:i]];
This is how im adding the data to my datasets. How can i add xIndex without any value?! initWithValue does not accept null values.

@liuxuan30
Copy link
Member

liuxuan30 commented Jul 29, 2016

you just not call [ChartDataEntry alloc] initWithValue:val xIndex:i] on i
x [0,1,2,3,4]
y [1, ,3,4,5]

@rashidasgari
Copy link
Author

Finally figured it out. Assuming there are P = M + N point on the chart, i added the first series from 0 to N index and the second one from N to M.

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

No branches or pull requests

2 participants