aspchart

How to display Error message into chart in asp chart controls

落爺英雄遲暮 提交于 2019-12-11 06:24:18
问题 I have a chart where I have to display message as "No Data Present",when rows.count == 0 else the bar chart as usually. May i know how to display that message. Thanks in advance. 回答1: Try this : protected void ChartExample_DataBound(object sender, EventArgs e) { // If there is no data in the series, show a text annotation if(ChartExample.Series[0].Points.Count == 0) { System.Web.UI.DataVisualization.Charting.TextAnnotation annotation = new System.Web.UI.DataVisualization.Charting

Change asp chart legend label width

本秂侑毒 提交于 2019-12-07 07:02:34
问题 Aspx <asp:Chart ID="Chart1" runat="server" Width="600px"> <Series> <asp:Series Name="Series1" ChartType="Pie" IsValueShownAsLabel="True" Legend="Legend1"> </asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="ChartArea1" AlignmentOrientation="All"> <AxisX TitleAlignment="Near"> </AxisX> </asp:ChartArea> </ChartAreas> <Legends> <asp:Legend Name="Legend1" > </asp:Legend> </Legends> </asp:Chart> Code behind Chart1.Titles.Add(new Title("Completed/Pending Count Anaysis",Docking.Top,new Font(

Change asp chart legend label width

≯℡__Kan透↙ 提交于 2019-12-05 13:14:43
Aspx <asp:Chart ID="Chart1" runat="server" Width="600px"> <Series> <asp:Series Name="Series1" ChartType="Pie" IsValueShownAsLabel="True" Legend="Legend1"> </asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="ChartArea1" AlignmentOrientation="All"> <AxisX TitleAlignment="Near"> </AxisX> </asp:ChartArea> </ChartAreas> <Legends> <asp:Legend Name="Legend1" > </asp:Legend> </Legends> </asp:Chart> Code behind Chart1.Titles.Add(new Title("Completed/Pending Count Anaysis",Docking.Top,new Font("Verdana", 12f, FontStyle.Bold),Color.Black)); Chart1.Series[0].XValueMember = "COLUMN_NAME"; Chart1