CorePlot Multiple data/graph in scaterplotview on iphone
<p>How to draw multiple lines in coreplot
i can plot one data like this</p>

<p>// Create a green plot area</p>

<pre><code>CPTScatterPlot *dataSourceLinePlot = [[[CPTScatterPlot alloc] init] autorelease];
dataSourceLinePlot.identifier = @"Green Plot";

CPTMutableLineStyle *lineStyle = [[dataSourceLinePlot.dataLineStyle mutableCopy] autorelease];
    lineStyle.lineWidth = 2.f;
lineStyle.lineColor = [CPTColor greenColor];
    lineStyle.dashPattern = [NSArray arrayWithObjects:[NSNumber numberWithFloat:8.0f], nil];
dataSourceLinePlot.dataLineStyle = lineStyle;

dataSourceLinePlot.dataSource = self;

    // Put an area gradient under the plot above
CPTColor *areaColor = [CPTColor colorWithComponentRed:0.0 green:1.0 blue:0.0 alpha:1];
CPTGradient *areaGradient = [CPTGradient gradientWithBeginningColor:areaColor endingColor:[CPTColor clearColor]];
//areaGradient.angle = -90.0f;
CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient];
dataSourceLinePlot.areaFill = areaGradientFill;
// dataSourceLinePlot.areaBaseValue = CPTDecimalFromString(@"0.05");// green line  shade below point

    // Animate in the new plot, as an example
    dataSourceLinePlot.opacity = 0.2f;
    dataSourceLinePlot.cachePrecision = CPTPlotCachePrecisionDecimal;
[graph1 addPlot:dataSourceLinePlot];
</code></pre>

<p>but how to add 2 graph  data ,since i want to compare week data </p>

<p>i know i have to tweak this , but this code takes eiher of the value but not both'</p>

<pre><code>-(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index 
{
    NSDecimalNumber *num = nil;
     {
        if ( index % 8 ) {
             num = [[dataForPlot objectAtIndex:index] valueForKey:(fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y")];
            // Green plot gets shifted above the blue
            if ( [(NSString *)plot.identifier isEqualToString:@"Green Plot"] ) {
                if ( fieldEnum == CPTScatterPlotFieldY ) {

                    num = (NSDecimalNumber *)[NSDecimalNumber numberWithDouble:[num doubleValue] + 1.0];
                }
            }

            else if ( [(NSString *)plot.identifier isEqualToString:@"Green Plot1"] ) {
                num = [[dataForPlot1 objectAtIndex:index] valueForKey:(fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y")];
                if ( fieldEnum == CPTScatterPlotFieldY ) {
                    num = (NSDecimalNumber *)[NSDecimalNumber numberWithDouble:[num doubleValue] + 1.0];
                }
            }
        }
        else {
            num = [NSDecimalNumber notANumber];
        }
    }

    return num;
}
</code></pre>

<p><strong>i wan to show both Green plot and Green plot 1 data</strong> </p>
