这是我的图表:
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>
如何在蓝框上显示值?
答案 0 :(得分:7)
您可以从代码隐藏中执行此操作:
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>