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

Area chart with missing points #2067

Closed
HPRaval opened this issue Jan 12, 2017 · 1 comment
Closed

Area chart with missing points #2067

HPRaval opened this issue Jan 12, 2017 · 1 comment

Comments

@HPRaval
Copy link

HPRaval commented Jan 12, 2017

I want to draw area chart with missing points so i have skipped y value at particular x index. But steel my area chart is continuous,

Here is my data

var yVal2 = [ChartDataEntry]()
      yVal2.append(ChartDataEntry(value: 1, xIndex: 0))
      yVal2.append(ChartDataEntry(value: 0, xIndex: 1))
      yVal2.append(ChartDataEntry(value: 3, xIndex: 2))
      //yVal2.append(ChartDataEntry(value: nil, xIndex: 3))
      yVal2.append(ChartDataEntry(value: 3, xIndex: 4))
      yVal2.append(ChartDataEntry(value: 1, xIndex: 5))
      yVal2.append(ChartDataEntry(value: 2, xIndex: 6))
      yVal2.append(ChartDataEntry(value: 1, xIndex: 7))

My Chart looks like this
screen shot 2017-01-12 at 5 30 13 pm

But I want something like this

screen shot 2017-01-12 at 5 31 20 pm

@liuxuan30
Copy link
Member

ah hah, I used to develop such kinds of chart. Currently, this library does not support line breaking natively. But one workaround is that you use one data set for each line segment. e.g. in your screenshot, it should be 3 data sets ( 1 blue and 2 for red lines)

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