Class
TkGraph
In: rbSnack/tkSnackUtil.rb
Parent: TkCanvas

A generic class to provide graphs. Provides labels, title and plots points.

Methods

drawGraph, drawHorzLabels, drawVertLabels, getW1, getW2, getX, getY, new, plot,
Attributes

 [RW]  :borderColor
 [RW]  :graphColor
 [RW]  :labelSteps
 [RW]  :title
 [RW]  :worldFrame
Public Class methods
new( *args , &op_block) src

Standard constructor of a canvas

Public Instance methods
drawGraph() src

Draws this graph

drawHorzLabels() src

Draws the labels along the horizontal axis

drawVertLabels() src

Draws the labels along the verticle axis

getX(w1) src

This gets the X coordinate for the graph in terms of the first world coordinate

getY(w2) src

This gets the Y coordinate for the graph in terms of the second world coordinate

getW1(x) src

Returns the first world coordinate given an X (screen) coordinate

getW2(y) src

Returns the second world coordinate given a Y (screen) coordinate

plot(w1, w2, colour=") src

Plots given the first and second world coordinate in the given color.