Article Options
Premium Sponsor
Premium Sponsor

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

   Well, to be strictly accurate, it’s more a case of “Testing 1, 2, ... 1500”.    If at this stage you want to see if the code so far is working, put the next code snippet in the btnDraw’s Click event and then click the button.  

   Private Sub btnDraw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDraw.Click
        '  The various actions are now split into separate procedures to make
        '  the project more modular

        '  1.  Get the data
        GetData()
        '  2.  Get a Graphics object to use for the drawing methods
        g = GetGraphics()
        '  3.   Draw the Vertical Axis
        DrawVerticalAxis(g)

        '  :  More code to come ....


        ' n.   Assign the bitmap with the vertical axis drawn to the PictureBox
        PBBarChart.Image = bmap
    End Sub

  As you will see, the Tick Marks now range from 100 to 1500, reflecting the current highest sales figure of 1472 (Turkey).
You can tweak these values, run the project again and you will see that the vertical axis adjusts accordingly.

 

Sponsored Links