2012-06-03 4 views
0

프로젝트에 코어 플롯 터치를 추가하고 싶습니다. 이 자습서를 찾았습니다. http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application코어 플롯 터치 읽기 속성

그러나 CorePlotTouch의 최신 버전을 다운로드했으며 모든 속성을 설정할 수 없기 때문에 일부 변경된 것으로 보입니다. 재산이 읽기 전용이라고 말하는 많은 오류가 나타납니다. 예를 들어

:

CPTScatterPlot *xSquaredPlot = [[CPTScatterPlot alloc] 
            initWithFrame:graph.bounds]; 


    xSquaredPlot.dataLineStyle.lineColor = [CPTColor redColor]; 
    xSquaredPlot.dataLineStyle.lineWidth = 1.0f; 

lineColor 및 선폭 모두 읽기 전용 속성이며 내가 그들을 변경하는 다른 방법을 찾을 수 없습니다. 그래서 어떻게 라인의 색상이나 너비를 바꿀 수 있습니까?

답변

4

CPTMutableLineStyle 개체를 만들고 속성을 설정해야합니다.

CPTScatterPlot *xSquredPlot = [[CPTScatterPlot alloc] init]; 
CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle]; 
lineStyle.lineWidth = 1.0f; 
lineStyle.lineColor = [CPTColor redColor]; 
xSquredPlot.dataLineStyle = lineStyle; 
+0

감사합니다. bbarnhart :) – msmialko