1
我正在使用Core Plot繪製散點圖。它工作正常。但是我想在懸停CPTPlotSymbol時顯示當前值。請看下面的圖片: 將鼠標懸停在CPTPlotSymbol上時顯示工具提示
下面是一個示例代碼:
- (void)configurePlots
{
[...]
CPTMutableLineStyle *lineStyle = [myPlot.dataLineStyle mutableCopy];
lineStyle.lineWidth = 2.5;
lineStyle.lineColor = [CPTColor greenColor];
myPlot.dataLineStyle = lineStyle;
CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle];
symbolLineStyle.lineColor = [CPTColor greenColor];
CPTPlotSymbol *symbol = [CPTPlotSymbol ellipsePlotSymbol];
symbol.fill = [CPTFill fillWithColor:[CPTColor greenColor]];
symbol.lineStyle = symbolLineStyle;
symbol.size = CGSizeMake(6.0f, 6.0f);
myPlot.plotSymbol = symbol;
}
明顯......謝謝! –