7

簡単な説明

レンダリングされた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円グラフの画角を変更する必要があることです。多分それは非常に単純で、必要なプロパティがわからないか、ペイントイベントをオーバーライドする必要があるかもしれません。どちらの方法でも、あらゆる種類の方法が適用されます。

事前にジョージに感謝します。

4

2 に答える 2

1

問題#1の解決策

新しいラベルを追加し、カスタム値を入力すると役立ちました。さらに、私は変更しましたSeries.IsValueShownAsLabel = true;


問題#2の解決策

ChartArea.Area3DStyle.IsClustered = true;を設定してから設定する必要がありますChartArea.Area3DStyle.Inclination;

于 2011-02-24T09:15:58.593 に答える
0

とを使用xlhart.Rotationxlchart.Elevationます。

于 2012-06-01T12:52:47.700 に答える