A pie chart of the ASP.
Development Environment VS2010 Chart control is vs self-control
Front desk:
1<asp:chart id="Chart3"runat="Server"Width="900px">2<Legends>3<asp:legend backcolor="Transparent"Alignment="Center"Font="trebuchet MS, 8.25pt, Style=bold"4istextautofit="False"Name="Default"legendstyle="Column">5</asp:Legend>6</Legends>7<ChartAreas>8<asp:chartarea name="ChartArea1">9<area3dstyle rotation="0"/>Ten<axisy linecolor=" ----"> One<labelstyle font="trebuchet MS, 8.25pt, Style=bold"/> A<majorgrid linecolor=" ----"/> -</AxisY> -<AXISX linecolor=" ----"> the<labelstyle font="trebuchet MS, 8.25pt, Style=bold"/> -<majorgrid linecolor=" ----"/> -</AxisX> -</asp:ChartArea> +</ChartAreas> -</asp:Chart>
Backstage (partially commented):
1Chart3.backcolor =Color.moccasin;2Chart3.backgradientstyle =Gradientstyle.diagonalright;3Chart3.borderlinedashstyle =Chartdashstyle.solid;4Chart3.borderlinecolor =Color.gray;5Chart3.BorderSkin.SkinStyle =Borderskinstyle.emboss;6 7 //forma the chart area8chart3.chartareas[0]. BackColor =color.wheat;9 //Add and format the titleTenCHART3.TITLES.ADD ("title"); Onechart3.titles[0]. Font =NewFont ("Utopia", -, fontstyle.bold); A -CHART3.SERIES.ADD (NewSeries ("Pie") - { theChartType =Seriescharttype.pie, -Shadowoffset =2 - }); -chart3.series[0]. Label ="#VALX \ n \ nyou #PERCENT {P}";//show percentages and descriptions +chart3.series[0]. LegendText ="#VALX"; - Double[] Yvalues = { at, A, -, the, }; + string[] XValues = {"Excellent","inferior lattice","Good","Pass" }; A //label orientation of pie chart atchart3.series[0]["Pielabelstyle"] ="Outside"; -chart3.series[0]["Pielinecolor"] ="Black"; -chart3.series[0]. POINTS.DATABINDXY (XValues, yvalues); - - //each part blossoms - foreach(Datapoint Pointinchchart3.series[0]. Points) in { -point["exploded"] ="true"; to } +Savecharttoimg (CHART3,"4");
The preview image is as follows:
ASP. NET chart beautification + bound data--pie chart