Thursday, 26 February 2015

MS Chart set dynamically Legends using asp.net C#


//Html

<asp:Chart ID="Chart2" runat="server" style=" min-width:99%; display:none;"  onmouseover="return hidedownloadchart('ch2d','ch1d','ch3d');" >
            <Series>  
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </ChartAreas>
             <Legends>
            <asp:Legend TextWrapThreshold="200" font ="11px"></asp:Legend>
            </Legends>
        </asp:Chart>

//Legends

System.Web.UI.DataVisualization.Charting.Legend legend = new System.Web.UI.DataVisualization.Charting.Legend();
        legend.BackColor = System.Drawing.Color.Transparent;
        legend.Enabled = false;
        legend.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
        legend.IsTextAutoFit = false;
        legend.Name = "Default";

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...