0

コア プロットを使用して単純な折れ線グラフを作成しようとしていますが、実線を取得するのに問題があります。私が抱えている問題は、線がデフォルトで破線になっているように見えることです。

私は 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];
}
4

1 に答える 1

0

それは本当に破線ですか、それとも単なるアンチエイリアシング アーティファクトですか? 線の幅を広げたり、線の色を変更して最初にそれを除外してみてください。

于 2012-05-31T23:15:59.387 に答える