0
votes

I'm using Core Plot to draw a scatter graph. The points (which are in an ordered sequence) are connected by line segments. I need to visualize the line direction (and it might overlap or cross itself). I've been able to set each of the points to a different color form dark to light, like this:

enter image description here and enter image description here

I'd like to have the line change color, too, in a linear fashion from the first point to the last. How can I use CPTGradient to do this?

1

1 Answers

0
votes

You can't. The gradient options for lines in Core Plot are the lineGradient to give the line a 3D effect or the lineFill (with a gradient fill) to fill the entire line path with a gradient. The lineFill works by using the line path as a mask to show part of a rectangle filled with the gradient.