嗨我想在我的C#aplication(winform)中制作图表
我的目标很简单我想在图表中显示有多少人选择答案,B答案等
像这样的事
在该聊天中使用35值' y,我想根据总答案总数(答案A +答案B = 15 + 20)使其成为恐龙。
this.myChart.Series["Answer"].Points.AddY("Answer A");
this.myChart.Series["Answer"].Points.AddY("Answer A");
this.myChart.Series["Answer"].Points.AddY("Answer B");
//AND (method B)
this.myChart.Series["Answer"].Points.AddXY("Answer A", 1);
this.myChart.Series["Answer"].Points.AddXY("Answer B", 1);
this.myChart.Series["Answer"].Points.AddXY("Answer B", 2);
this.myChart.Series["Answer"].Points.AddXY("Answer B", 3);
this.myChart.Series["Answer"].Points.AddXY("Answer B", 4);
this.myChart.Series["Answer"].Points.AddXY("Answer A", 2);
//结果方法B
但结果并非如我所愿 anyidea怎么做?
答案 0 :(得分:1)
int sumOfAnswerA = // get the sum of ppl choose A from your data
int sumOfAnswerB = // get the sum of ppl choose B from your data.
现在您可以在图表中设置点
this.myChart.Series["Answer"].Points.AddXY("Answer A", sumOfAnswerA );
this.myChart.Series["Answer"].Points.AddXY("Answer B", sumOfAnswerB );