Sergey Grishchev
Sergey Grishchev

Reputation: 12051

Customize CorePlot gridLineStyle

In my CorePlot implementation I have a grid line style that looks like this:

enter image description here

I implement it as simple as that:

CPTMutableLineStyle *gridLineStyle = [CPTMutableLineStyle lineStyle];
gridLineStyle.lineColor = [CPTColor grayColor];
gridLineStyle.lineWidth = 0.6f;

What I'd like to have, though, is the line style that would look like this:

enter image description here

Any ideas of how do you customize CPTMutableLineStyle to make my line be like this? I haven't found anything similar in CorePlotExamples sample project by CorePlot. Thanks.

Upvotes: 1

Views: 587

Answers (1)

Eric Skroch
Eric Skroch

Reputation: 27381

Core Plot supports most of the built-in Core Graphics line drawing properties. The dashPattern is the property you need. It supports simple dotted or dashed lines as well as more complex dash patterns.

The "Control Chart" sample in the Plot Gallery example app shows several examples.

Upvotes: 2

Related Questions