2 graphs for comparison in one graph

I am developing an iPhone application that shows a line graph. I plan on selling fruit based on date.

I plan to use Core-plot to draw graphs.

I can draw a single graph using the library of basic plots.

As I draw 2 different graphs in the same graph, since both graphs should have the same x and y axis.

The scenario is similar to comparing two different graphs. E.g. if I want to compare sales of Apple and oranges for a month. I need to display line charts in the same plot so that I can learn about the ups and downs in sales.

Is it possible to use a kernel graph, or should I use some other library method or drawRect to achieve the same.

Thanks in advance,

Crayfish

+3
source share
1 answer

Yes it is possible. When downloading it, there is an example in the "Examples" folder. You basically create two CPTScatterPlot-s and give them two different identifiers. When called, -(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)indexyou check the identifier and return different values. Check out the examples folder for more information.

+1
source

All Articles