Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fill graph area with Color

I am trying to plot graph in which i want to fill graph area with custom color. But the color should be below only data lines which i have used to draw line graph and the remaining part should be as such.

like image 479
aks.knit1108 Avatar asked Feb 19 '12 17:02

aks.knit1108


1 Answers

Set the areaBaseValue and areaFill properties. The base value is the lower boundary of the filled area. This is normally set to the location value of the yRange so that the fill starts at the bottom of the plot area, but it doesn't have to be. The fill can be any CPTFill—a solid color (with optional transparency), an image, or a gradient. For example:

plot.areaFill = [CPTFill fillWithColor:[CPTColor redColor]];
plot.areaBaseValue = CPTDecimalFromInteger(0);
like image 98
Eric Skroch Avatar answered Oct 19 '22 18:10

Eric Skroch