Class ::tycho::Axis


Inherits: ::tycho::Picture - Source File - Contents: public procs - public commons - protected common
An axis for graphs and stuff.

This class defines an axis object that can be used when creating graphs, tables, and other such things. The user must give the x and y coordinates (in pixels) of the ruler base for positioning on the slate. Options include specifying the length of the axis in pixels, the number of significant digits to use in labelling the axis, the labelling style (ie whether every increment should be labelled, or just the end points or no labels), orientation of the axis (horizontal or vertical), and the length of the tick marks in pixels. The beginning and end of the axis can also be specified using the -from and -to options.

FIXME: Needs lots more features. (We're working on it...)

Here is an example on how to use it:

::tycho::slate .s
pack .s
# Create the axis
set axis [.s create Axis 50 50 -length 100 -from 0.0 -to 100 -digits 1]
# Move the axis
$axis coords 10 100
# Change the length
$axis configure -length 50

Reading Picture documentation.

Note: This is an experimental class.


Public constructs

Public Procs

construct id canvas slate tags x0 y0 args
Create a new Axis.
_digits id canvas slate digits
Update the -digits configuration option.
_from id canvas slate from
Update the -from configuration option.
_length id canvas slate length
Update the -length configuration option.
_ticklength id canvas slate ticklength
Update the -ticklength configuration option.
_to id canvas slate to
Update the -to configuration option.
coords id canvas slate args
Get or set the (base) coordinates of the axis.

Public Commons

_digits
The number of significant digits to display.
_from
The low value on the axis.
_length
The length of the axis in pixels.
_ticklength
The length of the tick marks in pixels.
_to
The high value on the axis.
methodtable
The virtual "method" table.
optiondefault
Default values of this item's options.

Protected constructs

Protected Common

tickfont
The font to use for the tick labels.

Index of classes



Author: Farhana Sheikh, John Reekie
Version: @(#)Axis.itcl 1.12 12/13/96 Copyright (c) 1996 The Regents of the University of California. All rights reserved. Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN \"AS IS\" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. PT_COPYRIGHT_VERSION_2 COPYRIGHTENDKEY