BigCheesy
BigCheesy

Reputation: 1138

Core plot fill graph along X axis?

I saw this question here: Coreplot graph fill color along y-axis

It answers how to fill the plot along the xaxis:

CPTPlotRange *range = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(4.0) length:CPTDecimalFromDouble(6.0)];
CPTFill *bandFill = [CPTFill fillWithColor:[[CPTColor whiteColor] colorWithAlphaComponent:.2f]];
[xAxis addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:range
                                                          fill:bandFill]];

However, that gives me a graph like this:

I'd like the white color to only be under the graph line, not above it.

Is there a way to do that?

Upvotes: 0

Views: 339

Answers (1)

Eric Skroch
Eric Skroch

Reputation: 27381

You could break the plot into pieces and use different plots for each segment. Apply an areaFill to the segment you want highlighted.

You can also add an enhancement request on the Core Plot issue tracker to have this added natively to the scatter plot.

Upvotes: 1

Related Questions