Search code examples
iosgraphcore-plotaxesios6

Core Plot shows axes in graph's image but not on actual graph


I recently upgraded Core Plot version to 1.2 in my iOS app. Before that (with core plot version 1.0) my graphs were getting plotted nicely and axes were looking pretty good. Thanks to Team Core Plot!!!

But after upgrading, my graphs stopped showing axes without any change in code. I checked the graph image using function imageOfLayer and it shows the axes. I tried to change backround color of my graph but that also didn't help. Following is my axes drawing code.

CPTMutableLineStyle *majorLineStyle = [CPTMutableLineStyle lineStyle];
majorLineStyle.lineColor = [CPTColor colorWithComponentRed:150/255.0 green:150/255.0 blue:150/255.0 alpha:1.0];
majorLineStyle.lineWidth = 1.0f;

x = axisSet.xAxis;
x.minorTickLabelOffset=50.0;
x.minorTicksPerInterval = 5;
//assigning the line style
x.axisLineStyle = majorLineStyle;

//For setting the y-Axis line style
y = axisSet.yAxis;
y.axisLineStyle = majorLineStyle;

Please tell me where I am going wrong.


Solution

  • Don't know why this happened but I just updated line majorLineStyle.lineWidth = 1.0f; to majorLineStyle.lineWidth = 3.0f; and it started showing axes. Unexpected but fulfilled the requirement. Hope this helps someone.