Creating A chart or graph

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Have a quick question: Lets say I have a Hashtable of
values hence
56 37.890
1 12.768
5 9.764
etc....
Is there a way for me to draw a chart in C# of this. FYI
its actually lottery numbers and the percentages of how
often they have repeated. I fugured this would be a good
project to teach myself the language (i read the numbers
off an Excel spreadsheet). I could give the full jist of
the program I am writing ut it would take up too much
space (if you would like to know post your email address
and Im more than willing to discuss). Thanks for any help
or pointing me to the appropiate place in the
dicomentation.
Thanks,
Homer (c# newbie)
 
Homer,

There are no charting classes provided with the .net framework (to my
knowledge anyway), but there are numerous third party controls available.

However, an interesting learning excercise would be to create your own bar
chart window. I would suggest you use Panel controls dynamically placed into
the window, each with a different BackColor. You can then set the size of
these based upon the value for each lottery number.

If you arent sure how to programmatically add the controls - create a new
form and place a panel control on it (with a background colour set), then
take a look in the generated InitializeComponent() method (you will need to
expand the "Windows Form Designer generated code" region to see this) and
examine how visual studio creates this panel control and add it to the list
of form controls.

From the above you should then be able to see how to create your own array
of panel controls, colour them and size them accordingly and add them to your
form. (Note you should do this in the constructor after the call to
InitializeComponent. Do not add anything in InitializeComponents as VS will
stomp on this when you next change the form).

Once you start to find your feet a bit more, you might look into creating a
Windows Control Library and encapsulating the bar chart code into your own
generic bar chart control!

Hope this helps,
Chris.
 
Hello,

One advantage of picking VB.NET to develop in, is the large quantity of 3rd
party controls to save you time and energy.

Check out ProEssentials at www.gigasoft.com.

We offer a Lite version for $149, Std for $399, and a Pro version for $1299.
The Lite version will likely handle your needs and provide powerful charting
to embed into your projects. Features like a) optimally utilizing control
real-estate given the chart's shape and data, b) zooming, c) exporting
images and data, d) maximization, and much more.

best regards,

Robert Dede
Gigasoft, Inc.
 
Back
Top