2014-02-17 75 views
1

我創建具有2餅圖情節像donutchart的曲線圖:首先是「餅圖」,第二個是「centerDonut」。核心劇情sliceWasSelectedAtRecordIndex用2餅圖

centerDonut只有1片,以白色爲主色調,值1

如果用戶按下一片「餅圖」,它用右手食指效果很好。 如果用戶按下一個「centerDonut」片段,方法將返回「pieChart」而不是「centerDonut」。

爲什麼會這樣? 我嘗試[self.centerDonut zPosition:1],但它不起作用。

-(void)initPlot { 
[self configureHost]; 
[self configureGraph]; 
//in configureChart I configure and add the pieChart and then the centerDonuts 
[self configureChart]; 
//I have 2 label in storyboard over the graph, set value of them and display. 
[self totLabelsOverAll]; 
} 
+0

餅圖在同一個圖中嗎?假設它們與* Plot Gallery *示例應用程序中的同心圓一樣,是否在pieChart上設置了「pieInnerRadius」以使其成爲一個圓環而不是一個整圓? –

+0

你好埃裏克,謝謝你的回覆。是在同一個圖表中,不,我沒有設置pieInnerRadius:我現在試試,並且我會告訴你它是否工作。謝謝:) – Tenaciousd93

+0

編輯:@EricSkroch,在pieChart中設置'self.pieChart.pieRadius =(self.hostView.bounds.size.height * 0.85)/ 2;',在centerDonut中設置'self.centerDonut.pieInnerRadius = (self.hostView.bounds.size.height * 0.475)/ 2;'。我是否必須在pieChart中設置相同的innerradius?謝謝 – Tenaciousd93

回答

2

pieChart設置pieInnerRadius使它成爲一個環。

相關問題