2

这是我的图表: 在此处输入图像描述

ASP.NET 代码:

<asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" Width="752px">
    <Series>
        <asp:Series Name="Series1" XValueMember="Column2" YValueMembers="Column1">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1" BorderColor="DarkGray">
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>

如何在蓝框中显示值?

4

1 回答 1

8

您可以从代码隐藏中执行此操作:

Chart1.Series["Series1"].IsValueShownAsLabel = true;

您也可以从您的 ASPX 代码中执行此操作:

<asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" Width="752px">
    <Series>
        <asp:Series Name="Series1" XValueMember="Column2" YValueMembers="Column1" IsValueShownAsLabel="true">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1" BorderColor="DarkGray">
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>
于 2013-07-04T20:49:27.207 回答