Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iPhone中使用powerplot创建线图_Iphone_Ios_Xcode_Graph - Fatal编程技术网

在iPhone中使用powerplot创建线图

在iPhone中使用powerplot创建线图,iphone,ios,xcode,graph,Iphone,Ios,Xcode,Graph,我正在使用powerplot在iphone中创建一个动态图形。在进行过程中,我成功地创建了一个图,但我不知道如何删除图中的默认dec值。 我想创建下面这样的东西,我从mockapps中概念化 float sourceData[7] = {33, 17, 24, 11, 11, 4, 10}; self.allData = [WSData dataWithValues:[WSData arrayWithFloat:sourceData withLen:7]]; self.allData

我正在使用powerplot在iphone中创建一个动态图形。在进行过程中,我成功地创建了一个图,但我不知道如何删除图中的默认dec值。

我想创建下面这样的东西,我从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];
如有任何意见,敬请谅解:)


使用
WSChart
linePlotWithFrame:…
方法在打印堆栈上生成
WSPlotAxis
的两个单独实例。第一个实例仅用于栅格,第二个实例用于轴标记和标签

方法
WSPlotAxis*axis=[aView getPlotAxis]
将返回类型为
WSPlotAxis
的第一个视图,该视图最初没有任何记号标签。如果要手动更改现有轴标记和标签,则需要使用获取第二个实例

WSPlotAxis *axis = (WSPlotAxis *)[self.chart plotAtIndex:2].view;
而不是
WSPlotAxis*axis=[aView getPlotAxis]

然后它就会像预期的那样工作