I draw a graph using the main graph. I am trying to plot a plot on a plot, but it contains a white background. But I want to build a chart with my own background. This is my code.
// setting frame of graph CGRect frame = [self.hostingView bounds]; self.graph = [[[CPTXYGraph alloc] initWithFrame:frame] autorelease]; // Add some padding to the graph, with more at the bottom for axis labels. self.graph.plotAreaFrame.paddingTop = 10.0f; self.graph.plotAreaFrame.paddingRight = 10.0f; self.graph.plotAreaFrame.paddingBottom = 25.0f; self.graph.plotAreaFrame.paddingLeft = 30.0f; // set background color of plot area by fill property and CPTColor self.graph.plotAreaFrame.plotArea.fill=[(CPTFill *)[CPTFill alloc] initWithColor: [CPTColor colorWithComponentRed:0.8 green:0.8 blue:0.8 alpha:1.0]]; // add graph to hosting view by hostedGraph property of hostingView self.hostingView.hostedGraph = self.graph;
In the code above, I tried to change the color, but I want to draw horizontal dashed lines for each tick along the y axis.
source share