iOS chart library - ios

I need to implement line chart with 2 colours like this:
So positive values should be blue and negative red and this is very important. Could u suggest iOS library to do this? I've already seen Charts, PNChart but they can't draw 2 coloured lines.
Thanks for any help!

If you were to subclass the LineChartRenderer in Charts, you would be able to use a mask on the bottom half of the screen when rendering the lines.
Basically create a new transparent CGContext, call super to draw the lines on it, mask it with CoreGraphics, then copy it on the original CGContext.

That isnt a problem, when zu seperate each colored part in a own dataset and append it to the datasets arrays of the charts.
This results in 4 blue and 4 red datasets which you must add in an array and set it to the chart data.
some example from my project
var dataSets = [LineChartDataSet]()
// create different datasets
let dataSet = createDataSet(with: entries)
dataSets.append(dataSet)
Result with example values:

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!

Heatmaps with multiple dataset + border

Is it possible to plot 2 datasets on heatmap, and differentiate between them by surrounding the second dataset with a border?
You can define border for particular point, like single field.
{x:9, y:4, value:91, borderWidth:10, borderColor:'red'}
http://jsfiddle.net/66Lcu9rr/

Is it possible to have the line chart data points in highcharts to be represented as a rectangle instead of a circle?

I have two series in my highchart. One bar and one line chart. I want the datapoints of the line chart be represented at rectangle or straight lines instead of dots. Is that possible?
Are you looking for "square"? Explained here.

Possible to Draw a Loop With HighCharts

We are currently using HighCharts for our typical bar, pie, line charts. But, we have been asked to plot some medical data that would end up resembling an irregular loop.
If I have an array of x,y points, would it be possible for me to draw this sort of graph with HighCharts? And, if so, can you point me to the right section of the documentation. I see that drawing things like rectangles and circles is possible, but I haven't found any info on drawing lines between arbitrary points.
I can see only three ways to achieve that, and none of them is easy, and have some limitations:
1) Use spline series with unsorted data - looks almost good, only tooltip doesn't work for unsorted data
2) Use scatter series with unsorted data - issue with tooltip is gone, but curves aren't smooth
3) Use renderer.path - doesn't have tooltip at all, and requires to add path manually.
And example of all three: http://jsfiddle.net/kEu3w/

Resources