I have to add four horizontal bars of equal widths to the bar chart. But I’m getting the first bar with less width than remaining. I had set baroffSet value to 0.0. When i changed the bar offset value to 0.3 I’m getting all the bars with equal width but the lables position is not getting correctly when i changed baroffset value.
Please any one help me.
Thanks in advance
Madan.
CPTColor *color = [CPTColor colorWithComponentRed:0.2705882352941 green:0.5058823529412 blue:0.6588235294118 alpha:0.6] ;
CPTBarPlot *barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor colorWithComponentRed:0.2705882352941 green:0.5058823529412 blue:0.6588235294118 alpha:0.6] horizontalBars:NO];
barPlot.dataSource = self;
barPlot.baseValue = CPTDecimalFromString(@"0");
barPlot.barOffset = CPTDecimalFromFloat(0.0f);
barPlot.barCornerRadius = 0.0f;
barPlot.barWidth=CPTDecimalFromFloat(0.30f);
CPTGradient *fillGradient = [CPTGradient gradientWithBeginningColor:[CPTColor colorWithComponentRed:0.2705882352941 green:0.5058823529412 blue:0.6588235294118 alpha:0.4] endingColor:color beginningPosition:0.0 endingPosition:1.0];
//fillGradient.angle = -90.0 ;
barPlot.shadowColor = [[UIColor blackColor]CGColor];
barPlot.shadowRadius = 1;
barPlot.shadowOffset = CGSizeMake(1,-1);
barPlot.shadowOpacity = 0.9;
barPlot.fill = [CPTFill fillWithGradient:fillGradient];
barPlot.identifier = @"Current Period";
barPlot.delegate = self;
[barChart addPlot:barPlot toPlotSpace:plotSpace];
[barChart release];
It sounds like the bars are getting cut off outside the plot area. Try adjusting the plot range in the plot space. Subtract half a bar width from the starting location and add the bar width to the length.