ASP. NET chart beautification + bound data--pie chart

Source: Internet
Author: User

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> -&LT;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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.