2011-10-21 12 views
1

我必須在條形圖中添加四個等寬的水平條。但是我得到的第一個寬度小於剩餘的寬度。我已將baroffSet值設置爲0.0。當我將欄偏移值更改爲0.3時,我獲得了所有具有相同寬度的欄,但當我更改baroffset值時,標籤位置得不到正確。 請任何人幫助我。在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]; 

回答

0

這聽起來像酒吧越來越切斷了陰謀的地區。嘗試調整繪圖空間中的繪圖範圍。從起始位置減去一半條寬度並將條寬添加到長度。

相關問題