1
我正在使用powerplot在iphone中創建動態圖。雖然經歷了http://www.field-theory.org/articles/powerplot/example.html我成功創建了一個圖,但我不知道如何刪除圖中的默認dec值。 在iPhone中使用powerplot創建折線圖
我想創建下面這樣的東西,我從mockapps概念化。
float sourceData[7] = {33, 17, 24, 11, 11, 4, 10};
self.allData = [WSData dataWithValues:[WSData arrayWithFloat:sourceData withLen:7]];
self.allData = [self.allData indexedData];
WSChart *tmp;
tmp = [WSChart linePlotWithFrame:[aView frame]
withData:self.allData
withStyle:kChartLineFilled
withAxisStyle:kCSGrid
withColorScheme:kColorGray
withLabelX:@"Days"
withLabelY:@"Drinks"];
[aView removeAllPlots];
[aView addPlotsFromChart:tmp];
[aView scaleAllAxisYD:NARangeMake(-10, 45)];
[aView setAllAxisLocationYD:0];
[aView setAllAxisLocationXD:-0.5];
WSPlotAxis *axis = [aView getPlotAxis];
[[axis ticksX] setTicksStyle:kTicksLabels];
[[axis ticksY] setTicksStyle:kTicksLabels];
[[axis ticksY] ticksWithNumbers:[NSArray arrayWithObjects:
[NSNumber numberWithFloat:0],
[NSNumber numberWithFloat:10],
[NSNumber numberWithFloat:20],
[NSNumber numberWithFloat:20],
nil]
withLabels:[NSArray arrayWithObjects:@"",
@"10%", @"20%", @"30%", nil]];
[axis.ticksX setTickLabelsWithStrings:[NSArray arrayWithObjects:@"Mon", @"Tue", @"Wed",
@"Thur", @"Fri", @"Sat", @"Sun", nil]];
[aView setNeedsDisplay];
任何意見理解謝謝:)