2014-02-17 77 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使它成为一个环。

相关问题