Solved Generate a chart showing percentages

Posted on 2013-06-08
Last Modified: 2013-06-13

I have a web app that calculates percentage scores for 4 subject areas.
eg 20, 40, 10, 30

What code would I use to show these scores in the chart,
whose markup is shown below. Thanks

    <asp:Chart ID="Chart5" runat="server" Height="336px" Width="348px">
            <asp:Title Text="">
            <asp:Series BorderWidth="5" ChartArea="MainChartArea" ChartType="Pie"
                Color="#000024" Name="MyCategories" YValuesPerPoint="6">
            <asp:ChartArea Name="MainChartArea">
Question by:murbro
LVL 20

Accepted Solution

informaniac earned 500 total points
Comment Utility
DataTable dt = new DataTable();

Datarow dr = dt.NewRow();
dr[1] = 50;

Chart5.DataSource = dt;
    Chart5.Series["MyCategories"].XValueMember = "subject";
    Chart5.Series["MyCategories"].YValueMembers = "percentage";

Open in new window


Author Closing Comment

Comment Utility
Thanks very much

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now