繁体   English   中英

核心图-折线图

[英]core plot - broken line graph

我正在尝试使用核心图生成一个简单的折线图,并且在获取实线时遇到了麻烦。 我遇到的问题是,似乎该行默认为虚线。

我是iOS和Xcode开发的新手,如果它非常简单,请原谅我。 我已经附加了我的代码,谁能看到我所缺少的内容吗? 提前致谢!

该代码基于项目随附的示例代码:

-(void)constructScatterPlot
{
graph = [[CPTXYGraph alloc] initWithFrame:CGRectZero];
CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme];
[graph applyTheme:theme];

graphView.hostedGraph = graph;    

graph.plotAreaFrame.borderLineStyle = nil;
graph.paddingLeft   = 0;
graph.paddingTop    = 0;
graph.paddingRight  = 0;
graph.paddingBottom = 0;


CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace;
plotSpace.allowsUserInteraction = YES;
plotSpace.xRange                = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(1.0) length:CPTDecimalFromFloat(100.0)];
plotSpace.yRange                = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(1.0) length:CPTDecimalFromFloat(20.0)];


CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;

CPTXYAxis *x          = axisSet.xAxis;
x.labelFormatter = nil;
x.labelingPolicy = CPTAxisLabelingPolicyNone;
x.axisLineStyle = nil;


CPTXYAxis *y = axisSet.yAxis;
y.labelFormatter = nil;
y.labelingPolicy = CPTAxisLabelingPolicyNone;
y.axisLineStyle = nil;

CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] init];

CPTMutableLineStyle *lineStyle = [dataSourceLinePlot.dataLineStyle mutableCopy];
lineStyle.lineWidth              = 1.f;
lineStyle.lineColor              = [CPTColor whiteColor];
dataSourceLinePlot.dataLineStyle = lineStyle;

dataSourceLinePlot.dataSource = self;

[graph addPlot:dataSourceLinePlot];
}

它是真的虚线还是抗锯齿的产物? 尝试增加线条宽度和/或更改线条颜色以先排除掉线条。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM