Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do remove the border around a core-plot graph

I am trying to remove the border around a core plot graph on the iPhone - but seem to be struggling on what should be simple in my mind.

Pointers please!

like image 728
Grouchal Avatar asked Feb 03 '10 18:02

Grouchal


4 Answers

You should be able to nil out the borderLineStyle on the graph's plotArea to remove the border:

graph.plotAreaFrame.borderLineStyle = nil;    // don't draw a border 

You could also create your own theme, using the ones in the framework as examples, and simply not set the borderLineStyle in that.

like image 95
Brad Larson Avatar answered Oct 13 '22 07:10

Brad Larson


None of the answers worked for me. This did the job:

graph.paddingLeft = 0; graph.paddingRight = 0; graph.paddingTop = 0; graph.paddingBottom = 0; graph.plotAreaFrame.borderWidth = 0; graph.plotAreaFrame.cornerRadius = 0; 
like image 25
Git.Coach Avatar answered Oct 13 '22 06:10

Git.Coach


OK I found out how to do it - quite simple really!

CPLineStyle *borderLineStyle = [CPLineStyle lineStyle];
borderLineStyle.lineColor = [CPColor whiteColor];
borderLineStyle.lineWidth = 1.0;

graph.plotArea.borderLineStyle = borderLineStyle;

where graph is your graph object - the reason I had a border in the first place was because I used CPPlainWhiteTheme.

Hope this helps others - is there a better way?

like image 31
Grouchal Avatar answered Oct 13 '22 06:10

Grouchal


You can set any line style to nil. This will cause the line to not be drawn at all.

like image 25
Eric Skroch Avatar answered Oct 13 '22 08:10

Eric Skroch