1
棒グラフに等しい幅の4本の水平バーを追加する必要があります。しかし、私は残っているよりも幅が小さい最初のバーを取得しています。私はbaroffSetの値を0.0に設定しました。私はバーのオフセット値を0.3に変更すると、幅が等しいすべてのバーが表示されますが、バラフセットの値を変更すると、lablesの位置が正しく表示されません。 いずれかお手伝いください。iphone sdkのコアプロットを使用して水平バーの幅が等しくない
ありがとうございます。 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];