Zhengqian Kuang
Zhengqian Kuang

Reputation: 1109

How to make a vertical range plot filled with color using CorePlot in iOS?

I need to show a graph in my iOS app something like

enter image description here

We have been using CorePlot for all the graphs and now I need to add a new kind as shown above. I found I could draw a graph like the above with CPTRangePlot. My problem is I can only draw a horizontal graph as shown below.

enter image description here

Is there any way to make it vertical? For a single curve we can easily do that by switching the value on X-axis and Y-axis. But for this kind of "range plot", I could not find a way to make it work for drawing the upper-bound and lower-bound lines and filling range with color can only be achieved on a normal horizontal graph. And yes, I can easily rotate the container view by 90 degrees, as I did in my testbed app. But I just cannot do this in our current app because this new added "range plot" graph is not the only one on the view. We have many other curves sharing the same plot space. So is there any hidden property or method to achieve the job? Thanks in advance!

Upvotes: 0

Views: 52

Answers (1)

Eric Skroch
Eric Skroch

Reputation: 27381

I just added a fillDirection property to the range plot to enable this feature. You'll need to use the latest code from the release-2.3 branch.

Upvotes: 1

Related Questions