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

I need to show a graph in my iOS app something like
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.
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!

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.

Related

line chart with values and dates graph iOS

I have previously used core plot and jawbone line chart view but now I want grid (background) on graph.
I wanna make exactly like above image any help would be appreciated and also please be specific while posting some third party libs and all.
How can I achieve the above graph (if selected dot/value to show callout) with callout?
Note- In X- axis (dates) and Y- axis (values) are there.
Edit 1:
Is it possible to achieve in core plot? If Yes, How and please be specific.
Thanks in advance.
You can use a plot space annotation to label the callouts. A simple rounded rectangle shape for the labels is easy—set the fill, borderLineStyle, and cornerRadius of the Core Plot text layer used for the annotation. If you need the little arrow on the side of the annotation, you should be able to draw that by using a stretchable image for the fill.

shinobi chart gridline end in data point instead of going all the way to the top of chart

I'm drawing a chart in an iOS app and I want the gridlines to start in the x axis but end in the data point instead of extending all the way up to the top.
Is this possible?
Thanks in advance.
NC
Disclaimer: I work for ShinobiControls
The shinobicharts framework doesn't currently support this as an out-of-the-box feature.
A workaround may exist though. You may be able to add your own gridline subviews by using the SChartAxis method pixelValueForDataValue: to work out where in the plot area coordinate space you should draw your vertical line up to for a given data point.
Once you have your coordinates there are various ways you could draw your gridlines:
Add a canvas view behind or in front of the chart (depending on what effect you want). Then use your coordinates to draw your gridlines using CoreGraphics or some other drawing technique.
Create individual UIViews that each represent a gridline using your coordinates and add these behind or in front of the chart.
One thing to be aware of with this technique is that the gridlines will not automatically update when you pan and zoom. In order to do this you will need to override one of the chart's delegate methods that notify you of range changes and update your drawn gridlines to match the new data point positions.
Another potential workaround could be to use a column series to mimic gridlines. If you create a column series and feed it the same data points as your original series this will result in columns that go up to the y-value of each data point. You could then use the property interSeriesSetPadding on SChartAxisStyle to cause the columns to appear very thin.
I hope that information is useful!

How to achieve customizations in core plot -scatter plot?

I am working on core Plot library in ios.I was able to add mutliple scatter plots to graph.I am not able to achieve following customizations(Pls refer attached image):
Need to connect multiple Y-axis points and draw a vertical line.
On X-axis,need to add number of tasks(Custom UI views) for every month.
Thanks for any help you can give.
Use a third scatter plot to draw the vertical lines.
Don't add subviews to the Core Plot hosting view. Add them to the hosting view's superview. You can use the plot space to find the coordinates along the x-axis to anchor your custom views.

How to add crosshair vertical line in line graph using Core Plot framework?

I am using core plot framework for drawing the line graph in iPhone and it is working fine.I am displaying system time on X- axis and Temperature on Y- axis.I need to draw the cross hair vertical line that indicate the selected value on the line graph. for example
I would highly appreciate if someone can give me some suggestion to solve this issue.
Thanks in advance.
You can use another axis or scatter plot to draw the line. Using an axis is simpler if all you need is a single horizontal or vertical line. Set all of the tick and grid line styles to nil and use the orthogonalCoordinateDecimal to position it in the correct location. There is a demo using a scatter plot to draw a crosshairs over the selected point in the Mac version of the CPTTestApp example app.

Highcharts - multiple plot with the same x scale

I want to make a multiple plots with the x-axis aligned so that we can compare two set of data. I want it to look like this
https://stackoverflow.com/a/11796553/229075
In my case there are some addition requirement that some of the plot are lines and some are bar. So the default scale does not align even if the data range are the same.
I found some good suggestion about "stacking" the charts. It is a little bit complicated but a promising way to try.
https://stackoverflow.com/a/12179023/229075
However I also have other use case that may push the envelop of simple stacking. For example, I'd like to do scatter plot matrix sometime when both x-axis and y-axis have to align like this
http://www.statmethods.net/graphs/images/spmatrix3.png
Rather than putting many chart in one Highchart, this may requires have many separate charts but have better control in how the axis is layout.
If you want to use one one chart, you can use linkedTo option to connect axis.
If you want more simple charts, you can manage to connect axis using event afterSetExtremes, where you can call setExtremes() for another chart.

Resources