ios
ios

Reputation: 6164

CorePlot Remove bar shadow effect

In iPhone App i am using core Plot vertical bar chart.

How to Remove shadow effect in Vertical Bars?

Here as shown in figure bars are displaying with shadow

enter image description here

Here is the code:

CPBarPlot *barPlot = [CPBarPlot tubularBarPlotWithColor:[CPColor colorWithComponentRed:111 green:129 blue:113 alpha:1.0] horizontalBars:NO];

barPlot.shadowColor=NO;

How can I remove this shadow effect?

Please Help and Suggest.

Thanks

Upvotes: 2

Views: 2181

Answers (2)

humblePilgrim
humblePilgrim

Reputation: 1806

I faced the white colored plots isssue

yourPlot.fill = [CPTFill fillWithColor:[CPTColor colorWithComponentRed:80.0f / 255.0f green:186.0f / 255.0f blue:224.0f / 255.0f alpha:1.0f]];

this gives me the desired color..

Upvotes: 0

Claes
Claes

Reputation: 66

Haven't tested this, but my guess is that what you see is not a shadow but a gradient fill generated by the use of "tubularBarPlotWithColor". The shadow is probably something outside the bar borders.

Instead, try creating the bar plot with:

CPBarPlot *barPlot = [[CPBarPlot alloc] init];

Then use:

barPlot.fill = [CPFill fillWithColor:myCPColor];

Or if you actually want a gradient fill:

fillGradient = [CPGradient gradientWithBeginningColor:myCPColorBegin endingColor:myCPColorEnd]; 
barPlot.fill = [CPFill fillWithGradient:fillGradient];  

Hope this helps! Claes

Upvotes: 5

Related Questions