분산 플롯에 CorePlot을 사용하고 있으며 여기에있는 색상 효과로 분산 플롯의 원을 얻는 방법을 알고 싶습니다. http://i.stack.imgur.com/7ZcqY.jpg 색상은 CPTXYScatterPlot - Can I set the Z order of plot symbols?입니다. iOS 코어 플롯 - 분산 플롯 기호 색상 모양
CPTPlotSymbol *circlePlotSymbol = [CPTPlotSymbol ellipsePlotSymbol];
// Obviously for a real bubble chart you'll want to get the color from somewhere so they're not all the same
CPTColor *endColor = [CPTColor redColor];
CPTColor *startColor = [endColor colorWithAlphaComponent:0.4f];
CPTGradient *gradient = [CPTGradient gradientWithBeginningColor:startColor endingColor:endColor];
그런 다음 방사형으로 그라데이션 유형을 설정하고 plotSymbol에 채우기로 그라데이션을 설정하여
symbolForScatterPlot
구현에서
하지만 당신이 얻는 효과를 얻을 수 없습니다. 플롯에서 각 원에 대해 가장 밝은 점은 중심에 있지 않고 상단으로 기울어 져 있습니다. – Dinesh
@Dinesh - 단계를 잊어 버렸기 때문에 ... 그라디언트의 startAnchor 속성을 중심에서 벗어난 값으로 설정하십시오. 위에서 편집 한 코드. –