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

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...