开发者

core plot help to draw two plots together

How开发者_StackOverflow中文版 to draw both bar and scatter plot together? I have created object of both in viewDidLoad and the datasource also read correctly. I add it to the same plotspace. But no use!


Have you looked at the example programs? Many of them show how to add multiple plots (of the same or different types) to a single graph.

What are you seeing? Does either plot show up, or neither of them?


Just add multiple plots to graph with graph addPlot

CPTScatterPlot * sPlot = [[CPTScatterPlot alloc] init];
    dataLineStyle = [CPTMutableLineStyle lineStyle];
    sPlot.identifier = @"SomeIdentifier"

    dataLineStyle.lineWidth = 1.0f;
    dataLineStyle.lineColor = [CPTColor redColor];
    sPlot.dataLineStyle = dataLineStyle;
    sPlot.dataSource = self;

    greenCirclePlotSymbol = [CPTPlotSymbol ellipsePlotSymbol];
    greenCirclePlotSymbol.fill = [CPTFill fillWithColor:[CPTColor redColor]];
    greenCirclePlotSymbol.size = CGSizeMake(5.0, 5.0);
    sPlot.plotSymbol = greenCirclePlotSymbol;  

    [graph addPlot:sPlot];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜