System.Web.UI.DataVisualization.Charting Chart AxisLabel

时间:2011-05-02 10:08:54

标签: asp.net-mvc-3

我正在使用DataVisualization.Charting图表。我需要设置Y轴标签,我得到了数量,但需要在数量上添加$符号,Datapoint.AxisLabel仅适用于X轴。

                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轴标签的定义和方式。

1 个答案:

答案 0 :(得分: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>