簡単な説明
レンダリングされた3D円グラフの画角と自動ラベルの値を、円ラベル名から対応する円値に変更する必要がある特定のアプリケーションにグラフを使用しています。
チャートは次のようになります。
初期化
これは私がそれを初期化する方法です:
Dictionary<string, decimal> secondPersonsWithValues = HistoryModel.getSecondPersonWithValues();
decimal[] yValues = new decimal[secondPersonsWithValues.Values.Count]; //VALUES
string[] xValues = new string[secondPersonsWithValues.Keys.Count]; //LABELS
secondPersonsWithValues.Keys.CopyTo(xValues, 0);
secondPersonsWithValues.Values.CopyTo(yValues, 0);
incomeExpenseChart.Series["Default"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
incomeExpenseChart.Series["Default"].Points.DataBindXY(xValues, yValues);
incomeExpenseChart.ChartAreas["Default"].Area3DStyle.Enable3D = true;
incomeExpenseChart.Series["Default"].CustomProperties = "PieLabelStyle=Outside";
incomeExpenseChart.Legends["Default"].Enabled = true;
incomeExpenseChart.ChartAreas["Default"].Area3DStyle.LightStyle = System.Windows.Forms.DataVisualization.Charting.LightStyle.Realistic;
incomeExpenseChart.Series["Default"]["PieDrawingStyle"] = "SoftEdge";
基本的に、私はデータベースからデータをクエリしHistoryModel.getSecondPersonWithValues();
てペアを取得しています。Dictionary<string, decimal>
ここで、キーは人で、値はammountです。
問題#1
私が必要としているのは、マークされたラベルを人の名前から金額に変更したり、同じ色の金額の別のラベルを追加したりできるようにすることです(画像を参照)。
問題#2
もう1つの問題は、3D円グラフの画角を変更する必要があることです。多分それは非常に単純で、必要なプロパティがわからないか、ペイントイベントをオーバーライドする必要があるかもしれません。どちらの方法でも、あらゆる種類の方法が適用されます。
事前にジョージに感謝します。