2011-05-02 65 views
0

我正在使用DataVisualization.Charting圖表。我需要設置Y軸標籤,我得到的金額,但需要添加$符號的數額,Datapoint.AxisLabel只適用於X軸。System.Web.UI.DataVisualization.Charting圖表AxisLabel

   point = new DataPoint(); 
       point.AxisLabel = String.Format("{0:MM/dd/yy}", Xdate[i]);    
       double result = Convert.ToDouble(results[i]); 
       point.YValues = new double[] { (result) };     
       seriesDetail.Points.Add(point); 

Plz幫助我知道在哪裏定義Y軸標籤以及如何。

回答

0

請看下面的例子:

<asp:Chart runat="server" ID="Chart"> 
       <legends>     
       </legends> 
       <borderskin></borderskin> 
       <series> 
       </series> 
       <chartareas> 
        <asp:ChartArea Name="ChartArea1"> 
         <area3dstyle /> 
         <axisy Title="Title of Y axis" > 
          <LabelStyle /> 
          <MajorGrid /> 
         </axisy> 
         <axisx Title="Title of X axis"> 
          <LabelStyle /> 
          <MajorGrid /> 
          <MinorGrid /> 
         </axisx> 
        </asp:ChartArea> 
       </chartareas> 
      </asp:Chart>