Tag: 核心情节

核心绘图:如何在两行之间渲染一个颜色

这是我的目标。 而问题是我不知道在线之间呈现颜色。 我会感激任何build议。谢谢。

如何用定时器重复调用一个方法(重新加载…)来为一个转换设置animation

我在我的xcode项目中实现了corePlot 。 我试图用animation“爆炸”饼图的一部分。 这是我正在使用的方法: – (void)radialOffsetForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)idx { if (myIndex == idx) { return 20; } return 0; } 我有另一种方法调用[pieChart reloadRadialOffset]; 。 例如: – (void)thisMethod { [pieChart reloadRadialOffset]; } 我如何animationreloadRadialOffsets ?

核心图1.0:为图例提供自定义标签

我正在使用CorePlot 1.0,并想添加一个图例到我的条形图 (这是一个子类XYGraph)。 我有viewController中的数据源和图例标题方法,它实例化条形图并将自己设置为其委托。 我已经花了不同的代表和传奇设置几个小时,但无法find我的错误。 你能否提供一些我可能犯错的提示? 我已经将子图XYGraph生成如下的条形图: .h @interface BarLineChart : CPTXYGraph @property (strong, nonatomic) id <CPTPlotDataSource, CPTBarPlotDataSource, CPTBarPlotDelegate, CPTPlotSpaceDelegate> delegate; @end 在我的实现.m中 ,我设置了如下的图例: // Add legend CPTLegend *legend = [CPTLegend legendWithGraph:self]; legend.fill = [CPTFill fillWithColor:[CPTColor colorWithGenericGray:0.15]]; legend.borderLineStyle = axisLineStyle; legend.cornerRadius = 10.0; legend.swatchSize = CGSizeMake(16.0, 16.0); CPTMutableTextStyle *legendTextStyle = [CPTMutableTextStyle textStyle]; legendTextStyle.color = [CPTColor […]

iOS Core Plot“函数转换” – 仅Y轴原点

现在我找不到如何做这件事,我的graphics每次都绘制好,但是我想把graphics向上移动,就像当你有f(x) + n 。 所以,我想要做的是改变Y的原点,所以我可以绘制我的(x,0)点。 我不想在X轴上画出我的观点,我没有看到那条线。 我希望我的零点Y实际上是从第三点开始的,但不能同时转换graphics。 这里是我想要做的图片(参见绿线和Y点):

CorePlot:无法更改饼图位置(位移)

我无法改变饼图的位置 (我希望它相对于图例更加左侧,以便图例不覆盖饼图)。 基本上我想把它转移到左侧,让图例显示。 我尝试修改以下属性 (但对饼图位置没有明显的影响): // pieChartGraph is a CPTPieChart object pieChartGraph.graph.position = CGPointMake(-100, 0); // I also tried: pieChart.position = CGPointMake(-100, 0); // and also playing with: pieChart.anchorPoint 这是我得到的,也是我的代码 (顺便说一下,标题不显示): pieChartGraph = [[CPTXYGraph alloc] initWithFrame:self.pieChartgraphHostView.bounds]; self.pieChartgraphHostView.hostedGraph = pieChartGraph; pieChartGraph.plotAreaFrame.masksToBorder = NO; pieChartGraph.axisSet = nil; pieChart.title = @"title"; // <– BTW, the title does not […]

无法使用核心图iOS在3个不同视图中绘制3个图

我正在使用核心图库来绘制一个图在3个不同的视图..问题是3之间只有3图得到正确显示…但是,如果我分别绘制每个图,然后他们总是显示出正确的..任何线索会对我有很大的帮助。谢谢 //In ViewWillAppear -(void) viewWillAppear:(BOOL)animated { dataPoints = [[NSMutableArray alloc]init]; // Create graph from theme CPTgraph1 = [(CPTXYGraph *)[CPTXYGraph alloc] initWithFrame:CGRectZero]; CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; [CPTgraph1 applyTheme:theme]; CPTXYPlotSpace *plotSpace1; plotSpace1= (CPTXYPlotSpace *)CPTgraph1.defaultPlotSpace; CPTScatterPlot *dataSourceLinePlot1 = [(CPTScatterPlot *)[CPTScatterPlot alloc] initWithFrame:CPTgraph1.bounds]; CPTgraph2 = [(CPTXYGraph *)[CPTXYGraph alloc] initWithFrame:CGRectZero]; //CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; [CPTgraph2 applyTheme:theme]; CPTXYPlotSpace *plotSpace2; […]

核心图:轴交替填充自定义轴标签

我正在使用Core Plot库在iOS上绘制graphics。 我想在yAxis的网格线之间添加颜色。 我已经设法做到这一点,设置轴的alternatingBandFills属性。 不过,我也必须在yAxis上使用自定义标签,当我提供自定义标签时,alternatingBandFills属性由于某种原因而不起作用。 任何帮助如何将颜色添加到网格线之间的空间yAxis以及使用自定义标签将不胜感激。 我现在使用的代码如下所示: CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.hostedGraph.axisSet; CPTXYAxis *yAxis = axisSet.yAxis; yAxis.orthogonalCoordinateDecimal = CPTDecimalFromDouble(minValueX); yAxis.labelingPolicy = CPTAxisLabelingPolicyNone; NSArray *yAxisTickLocations = [NSArray arrayWithObjects: [NSDecimalNumber numberWithDouble:lowerRedRangeFrom], [NSDecimalNumber numberWithDouble:lowerOrangeRangeFrom], [NSDecimalNumber numberWithDouble:greenRangeFrom], [NSDecimalNumber numberWithDouble:upperOrangeRangeFrom], [NSDecimalNumber numberWithDouble:upperRedRangeFrom], [NSDecimalNumber numberWithDouble:upperRedRangeTo], nil]; NSArray *yAxisLabels = [NSArray arrayWithObjects:@"Label1",@"Label2", @"Label3",@"Label4",@"Label5",@"Label6", nil]; NSUInteger labelLocationY = 0; NSMutableArray *customLabelsY = [NSMutableArray […]

CorePlot; 如何在使用doubleForPlot而不是numberForPlot时跳过数据

我有一个数据量巨大的CPTScatterPlot 。 我发现我可以通过在CorePlot中使用doubleForPlot而不是doubleForPlot来减less内存开销(从而减less时间)。 但是,当使用numberForPlot我有select返回nil如果一些数据丢失。 CorePlot将会在图中暂停而不连接相邻点。 使用doubleForPlot时可能是相同的吗? 有一些例外的价值,我可以返回和CorePlot将这视为一个缺失点? 谢谢埃里克! ;)

ios子视图在模拟器中颠倒

我已经在uiview子类中创build了一个活动指示器和一个标签,并在许多不同的标签中调用它。它在除了图表托pipe视图(CPTGraphHostinView)之外的大多数地方都按照预期工作。 在这个特定的视图中,子视图看起来是倒过来的。标签在旋转之上。我试图用imageview代替标签,它的图像颠倒了。 这是我的initWithframe方法 – (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code. NSLog(@"AI: init with frame"); spinnerView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; spinnerView.center = self.center; [self addSubview:spinnerView]; UILabel* loadingMsg = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 90.0f, 30.0f)]; loadingMsg.center = CGPointMake(spinnerView.center.x , spinnerView.center.y + spinnerView.bounds.size.height/2 +10); loadingMsg.textAlignment = UITextAlignmentCenter; loadingMsg.backgroundColor = [UIColor clearColor]; loadingMsg.text […]

如何在PieChart中给每个片段命名Coreplot iphone?

我在iPhone应用程序中绘制4片PieChart。 我想在饼图的每个切片中添加名称。 我正在使用Core-Plot9。 而且我想给PieChart中的每个切片分配不同的颜色。 这怎么办? 请build议我任何想法/示例代码来做到这一点。 请帮帮我。 提前致谢。