Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP.net VB.net Generate a chart showing percentages

Posted on 2013-06-08
2
Medium Priority
?
389 Views
Last Modified: 2013-06-13
Hi


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

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


    <asp:Chart ID="Chart5" runat="server" Height="336px" Width="348px">
        <Titles>
            <asp:Title Text="">
            </asp:Title>
        </Titles>
        <series>
            <asp:Series BorderWidth="5" ChartArea="MainChartArea" ChartType="Pie"
                Color="#000024" Name="MyCategories" YValuesPerPoint="6">
            </asp:Series>
        </series>
        <chartareas>
            <asp:ChartArea Name="MainChartArea">
            </asp:ChartArea>
        </chartareas>
    </asp:Chart>
0
Comment
Question by:Murray Brown
[X]
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
2 Comments
 
LVL 20

Accepted Solution

by:
informaniac earned 2000 total points
ID: 39232801
DataTable dt = new DataTable();
dt.Columns.Add("subject",typeof(string));
dt.Columns.Add("percentage",typeof(decimal));

Datarow dr = dt.NewRow();
dr[0]="Science";
dr[1] = 50;
dt.Rows.Add(dr);

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

Open in new window

0
 

Author Closing Comment

by:Murray Brown
ID: 39245396
Thanks very much
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

604 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