2

プロットされている 1 の y 値を持つデータ ポイントがあり、MS Chart コントロールは y 軸で 0.2 の増分を使用します。値が 100 を超えることを念頭に置いて、小数を使用しないように強制するにはどうすればよいので、y 軸で 1 の増分を強制することはできませんか?

4

2 に答える 2

5

コード ビハインドで、グラフ エリアの軸ラベル スタイル形式を設定します。

chtArea.AxisX.LabelStyle.Format = "{#,###}";
chtArea.AxisY.LabelStyle.Format = "{#,###}";

またはaspx

<ChartAreas>
<asp:ChartArea Name="MainChartArea">
<AxisY>
  <LabelStyle Format="#,###" />
</AxisY>
<AxisX IsMarginVisible="false">
   <LabelStyle Format="#,###" />                                
</AxisX>

于 2012-09-06T15:51:50.757 に答える
0

You need to write some custom logic to make that happen. You can use chart1.ChartAreas[0].AxisY.RoundAxisValues(); but then it will display 0.00 at all the points. I would suggest if there is only 1 data point with value 1, set YAxis Maximum property to 2 and set interval to 1

于 2012-05-09T18:23:00.013 に答える