更改Coreplot中网格线标记的颜色

时间:2014-06-17 18:37:35

标签: ios objective-c core-plot

我需要删除网格线标记,这些标记基本上是我图形上主要和次要网格线的扩展(设置为灰色)。我需要使这两种颜色保持一致。我无法找到要设置的必要属性。如果有人能帮助我,我真的很感激。我无法附加图像以更好地描绘我的问题。请随时询问任何后续问题,我会澄清。提前谢谢!

到目前为止,我的代码如下:

CPTMutableLineStyle *majorGridLineStyle;
// Grid line styles
majorGridLineStyle = [CPTMutableLineStyle lineStyle];
majorGridLineStyle.lineWidth = 0.75;
majorGridLineStyle.lineColor = [[CPTColor blackColor] colorWithAlphaComponent:0.1];

// Axises (X & Y)
CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;
x = axisSet.xAxis;
x.orthogonalCoordinateDecimal = CPTDecimalFromInt(0);
x.majorIntervalLength = CPTDecimalFromInt(1);
x.minorTicksPerInterval = 0;
x.labelingPolicy = CPTAxisLabelingPolicyNone;
x.majorGridLineStyle = majorGridLineStyle;
x.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0];
y = axisSet.yAxis;
y.labelingPolicy = CPTAxisLabelingPolicyAutomatic;
y.majorGridLineStyle = majorGridLineStyle;
y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0];

1 个答案:

答案 0 :(得分:0)

CPTColor定义与UIColor相同的基本颜色,包括+lightGrayColor+darkGrayColor

如果这些不符合您的需求,您可以使用+colorWithGenericGray:在黑白之间制作任何灰色,或+colorWithComponentRed:green:blue:alpha:制作任何RGB颜色,包括具有透明度的颜色。