Pregunta

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.

¿Fue útil?

Solución 2

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.

Otros consejos

I heard of that core plot 1.2 has bug with iOS 5. maybe you need back to <1.2 and wait fix.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top