[Tutor] Help with the following code..
ajkadri at googlemail.com
Thu Nov 23 22:40:39 CET 2006
Trying to draw a simple bar chart on canvas of Tkinter.
Here is code:
from Tkinter import *
root = Tk()
frame = Frame(root)
canvas = Canvas(frame,height=400,width=400)
canvas.create_line(50,350,350,350,width=2) # draws the X-axis
canvas.create_line(50,350,50,50,width=2) # draws teh Y-axis
canvas.create_rectangle(50,340,250,330) # this is the first HORIZONTAL BAR
I am not able to understand why two pairs of co-ordinates are supplied?? The
rectangle requires 4 co-ordinate pairs, Isnt it??
Also help me how to figure out the co-ordinate pairs of next bar ??
To HIM you shall return.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor