core plot custom Theme?

前端 未结 4 410
失恋的感觉
失恋的感觉 2021-02-04 12:40

I\'m using Core-Plot for a trend chart in an iPhone app and haven\'t found how to customize the background. I can create a theme using the built-in themes, like kCPPlainWhiteThe

4条回答
  •  悲哀的现实
    2021-02-04 13:08

    I used the .fill and .plot.AreaFrame.fill properties :

    plot = [[CPTXYGraph alloc] initWithFrame:CGRectZero];
    CPTTheme *theme = [CPTTheme themeNamed:kCPTSlateTheme];
    [plot applyTheme:theme];
    self.graph.collapsesLayers = NO;
    self.graph.hostedGraph = plot;
    
    plot.paddingLeft = 1.0;
    plot.paddingTop = 1.0;
    plot.paddingRight = 1.0;
    plot.paddingBottom = 1.0;
    plot.fill = [CPTFill fillWithColor:[CPTColor clearColor]];
    plot.plotAreaFrame.fill = [CPTFill fillWithColor:[CPTColor clearColor]];
    

    This works for me.

提交回复
热议问题