【发布时间】:2016-06-01 09:35:15
【问题描述】:
图表是使用如图所示的核心图设计的。
CPTScatterPlot *editableLinePlot = [[CPTScatterPlot alloc] init];
editableLinePlot.interpolation = CPTScatterPlotInterpolationCurved;
CPTMutableLineStyle *lineStyle = [editableLinePlot.dataLineStyle mutableCopy];
lineStyle.lineWidth = 3.0;
lineStyle.lineColor = [CPTColor redColor];
editableLinePlot.dataLineStyle = lineStyle;
editableLinePlot.dataSource = self;
editableLinePlot.delegate = self;
editableLinePlot.identifier = redPlotIdentifier;
editableLinePlot.plotSymbolMarginForHitDetection = 20.0;
绘图空间设置为
/*Set scatter plot space and range*/
CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace;
plotSpace.allowsUserInteraction = YES;
plotSpace.delegate = self;
plotSpace.xScaleType = CPTScaleTypeLog;
plotSpace.yScaleType = CPTScaleTypeLinear;
/* Auto scale the plot space to fit the plot data*/
[plotSpace scaleToFitPlots:[graph allPlots]];
但是当我向上或向下移动一个绘图点时,它不是一条平滑的曲线,而是显示为一个小尖峰。 我在这里错过了任何实现吗?请帮助,这个问题现在对我来说是个问题。
【问题讨论】:
标签: ios objective-c graph core-plot