Article Options
Premium Sponsor
Premium Sponsor

 »  Home  »  .NET Newbie  »  Chart Success: Second Helpings of Pie. Part 3  »  Getting the Data
 »  Home  »  Windows Development  »  Graphics  »  Chart Success: Second Helpings of Pie. Part 3  »  Getting the Data
Chart Success: Second Helpings of Pie. Part 3
by Ged Mead | Published  03/23/2005 | .NET Newbie Graphics | Rating:
Getting the Data

 

Getting the Input


We invite the user to enter the four elements of data - Name, Amount, Color and Pattern - for any single slice of the pie. If they don't enter a choice, a default value is used.

When the user is happy with the "current set" of data (that is, what will become one segment of the pie) a click on the Confirm button will fire the following code. This takes those four pieces of data and stores them in the arraylist as one composite GraphData element.

 

  Private Sub btnConfirm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConfirm.Click
  ' Add latest item of data to the arraylist
   If txtName.Text = "" Then txtName.Text = "No Name"
    Dim gd As New GraphData
    gd.Name = txtName.Text
    gd.Amount = nudValue.Value
    gd.Clr = clrPicked
    gd.Pattern = hatchPicked
    UserData.Add(gd)
  End Sub

I'm sure you will have spotted the inclusion of the line which checks that the user has actually entered a Name and, if not, assigns some text for display.

Comments    Submit Comment

Comment #1  (Posted by an unknown user on 03/25/2005)
Rating
The good is getting even better. Cool job, Ged.
 
Comment #2  (Posted by an unknown user on 04/19/2005)
Rating
an amazing series of articles! It difficult to explain in such a simple way has you did. Thanks
 
Comment #3  (Posted by Ronan on 04/13/2006)
Rating
Hi i have read these tutorials and am looking your help.
I am trying to develop a pie chart interface in Visual Studio 2003 for a PDA (Smart Device Application) and tried your code. however it is not compatible as it does not recognise the drawPie and FillPie commands, etc. Do you have an example i could use to help me for this?
Thank you, Ronan
 
Comment #4  (Posted by PeteB on 05/22/2006)
Rating
reall useful.
 
Comment #5  (Posted by an unknown user on 12/08/2006)
Rating
Very Educative
 
Comment #6  (Posted by an unknown user on 08/27/2007)
Rating
clear / simple
 
Sponsored Links