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:Murray Brown
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 20

Accepted Solution

informaniac earned 500 total points
ID: 39232801
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

by:Murray Brown
ID: 39245396
Thanks very much

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…

695 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