Article Options
Premium Sponsor
Premium Sponsor

 »  Home  »  .NET Framework  »  Chart Success : GDI+ Graphics At Work Part 4  »  Summary
 »  Home  »  Windows Development  »  Graphics  »  Chart Success : GDI+ Graphics At Work Part 4  »  Summary
Chart Success : GDI+ Graphics At Work Part 4
by Ged Mead | Published  05/10/2005 | .NET Framework Graphics | Rating:
Ged Mead

Ged Mead (XTab) is a Microsoft Visual Basic MVP who has been working on computer software and design for more than 25 years. His journey has taken him through many different facets of IT. These include training as a Systems Analyst, working in a mainframe software development environment, creating financial management systems and a short time spent on military laptop systems in the days when it took two strong men to carry a 'mobile' system.

Based in an idyllic lochside location in the West of Scotland, he is currently involved in an ever-widening range of VB.NET, WPF and Silverlight development projects. Now working in a consultancy environment, his passion however still remains helping students and professional developers to take advantage of the ever increasing range of sophisticated tools available to them.

Ged is a regular contributor to forums on vbCity and authors articles for DevCity. He is a moderator on VBCity and the MSDN Tech Forums and spends a lot of time answering technical questions there and in several other VB forum sites. Senior Editor for DevCity.NET, vbCity Developer Community Leader and Admin, and DevCity.NET Newsletter Editor. He has written and continues to tutor a number of free online courses for VB.NET developers.

 

View all articles by Ged Mead...
Summary

  This project creates a more versatile and better looking bar chart.   It splits the main drawing tasks into separate procedures.  However, the code is still rather unwieldy and this makes a strong case for  creating a  3DBar class with settable properties for width, depth, height, color, etc.   It would then be possible to include  properties well beyond the UI choices we have used here, and of course it conforms more closely to the OOP approach to developing in VB.NET.

In this article I explained or used the following:

  •  Bitmap object
  •  Brushes
  •  Dispose
  •  Do While Loop
  •  DrawLine
  •  DrawString
  •  FillPolygon
  •  Font object
  •  Graphics Object
  •  Pen
  •  Structure

   In the next article in this series, we will move on to another, sometimes more dynamic, type of chart - the line chart.

How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent
Tell us why you rated this way (optional):

Article Rating
The average rating is: No-one else has rated this article yet.

Article rating:4.19444444444445 out of 5
 36 people have rated this page
Article Score29759
Article Series
Related Articles
Comments    Submit Comment

Comment #1  (Posted by an unknown user on 05/13/2005)
Rating
Great article, Ged. Thanks for your efforts.
 
Comment #2  (Posted by betrl8thanever on 05/24/2005)
Rating
Excellent work Ged. Very impressive.
 
Comment #3  (Posted by Chris on 07/11/2005)
Rating
This article was great. However in the procedure DrawVerticalAxis, you are declaring VertLineLength as local. VertLineLength was previously declared global in the form. Because of the local declaration the Vertical Line Length is reset back to zero after the procedure call and all the 3d bars display a vertical reading of zero. I removed Dim VertLineLength As Integer = PBBarChart.Height - (BaseMargin + TopMarg and set VertLineLength = PBBarChart.Height - (BaseMargin + TopMargin). The 3d bars now display correctly.

 
Comment #4  (Posted by XTab on 07/11/2005)
Rating
Chris, Many thanks for spotting that error in the article. I have now corrected it. Ged Mead.
 
Comment #5  (Posted by an unknown user on 08/15/2005)
Rating
Looking forward to line charts!
 
Comment #6  (Posted by an unknown user on 12/29/2005)
Rating
Ged, great work done.
I have a problem related to pie chart. I am implementing image mapping on pie chart to do this I need to find out points arrary of a pie piece, after calling FillPie i am unable to get the coordinates of that pie piece. Plese post the way of getting it's coordinates. You can contect me on gupta.mk@rediffmail.com.I will be greatful to you for any help.
 
Comment #7  (Posted by an unknown user on 01/16/2006)
Rating
Best I have seen! Because I understand all, also with my bad English knowledge.
I tried it -> AND IT WORKS!!
 
Comment #8  (Posted by an unknown user on 03/06/2006)
Rating
Someone finally led us through a complete, basic app. Thanks
 
Comment #9  (Posted by an unknown user on 03/10/2006)
Rating
It's Great article
 
Comment #10  (Posted by an unknown user on 05/09/2006)
Rating
This helps a lot. Thanks
 
Comment #11  (Posted by an unknown user on 06/17/2007)
Rating
Thanks. this is the best i have learned.
 
Comment #12  (Posted by an unknown user on 06/17/2007)
Rating
hello sir
great work I am new in vb.net and for me it's take bit time to understand but your method is easy to understand but i have only one problem with draw horizontal lines it's draws one line but i cna't see other nine lines, I know it's my mistake but i could't find it, i have debuge the program but
this two are remains same all the time LineStart.Y -= VertGap LineEnd.Y -= VertGap , so i dont't know that it's wright and second thing about months, it's displays the months but all the name's of months displays on top of eachother so again there is my mistake but i could't find it so sir can you please help me with this
my e-mail is (bigbapu@hotmail.co.uk)
waiting for your kind rep.

have a nice time
 
Comment #13  (Posted by an unknown user on 12/28/2007)
Rating
Dear Sir Your lessons are more helpful. I'm a newbie VB users and I have a question: your Sub works properly whith positive values but if I put negative data in the Sales Data array they are set to zero.
How can I modifie your graphics for visualize negative values?
 
Comment #14  (Posted by Ged Mead on 12/28/2007)
Rating
Hi, Although I haven't tried this with negative values, the approach you will need to use is to readjust the axis so that instead of the base line being fixed at zero, which it is now, you physically move it up the vertical axis. This will allow negative values to "begin" (i.e. to start to be drawn) from the relevant point below the horizontal axis. Hope this helps. If I have time over the holiday I will try and create an additional demo to show this being done.
 
Comment #15  (Posted by an unknown user on 06/06/2008)
Rating
The best and most useful article I have ever read..A true blessing. THANK YOU VERY MUCH!!!
 
Comment #16  (Posted by an unknown user on 06/06/2008)
Rating
The best and most useful article I have ever read..A true blessing. THANK YOU VERY MUCH!!!
 
Comment #17  (Posted by an unknown user on 06/14/2008)
Rating
very useful article!
 
Comment #18  (Posted by Moon on 10/12/2008)
Rating
incentive for a company to grab control ,
 
Comment #19  (Posted by Zena Madara on 10/12/2008)
Rating
youtube is improving well, but i have little request: ,
 
Comment #20  (Posted by Andrew on 12/11/2008)
Rating
These articles are the best I have seen/read on this subject and I have been developing applications using VB for over 20 years. It takes me back to what my lecturer at University told us once - 'Keep it Simple and anything is possible!'
 
Comment #21  (Posted by Verynandus on 03/13/2009)
Rating
Thanks for your Tutorial
 
Comment #22  (Posted by on 10/11/2009)
Rating

 
Comment #23  (Posted by Some controversy exists regarding the dependence on 11/07/2009)
Rating
can take plavix woman can take plavix woman can take plavix woman . can take plavix woman can take plavix woman . can take plavix woman can take plavix woman . can take plavix woman buy online securely carisoprodol buy online securely carisoprodol . buy online securely carisoprodol buy online securely carisoprodol . buy online securely carisoprodol buy online securely carisoprodol . buy online securely carisoprodol buy online securely carisoprodol buy online securely carisoprodol . equivalent herbal ambien equivalent herbal ambien equivalent herbal ambien equivalent herbal ambien equivalent herbal ambien . equivalent herbal ambien equivalent herbal ambien equivalent herbal ambien equivalent herbal ambien equivalent herbal ambien .
 
Comment #24  (Posted by Ilopsav on 11/24/2009)
Rating
Cool site!: URLsWithNothing
 
Comment #25  (Posted by Bedloikv on 11/25/2009)
Rating
hi.. just droppin’ by your site.. it’s really cute… nice work!: URLsWithURL
 
Sponsored Links