marker

Name

marker -- Manage markers on a plotchart plot.

Synopsis

package require Plotchart::marker

set marker [Plotchart::marker name | %AUTO% -plot plotId]

$marker method args...

DESCRIPTION

A marker is an annotation on a plotchart plot that is drawn in the plot's coordinate systems. Markers are represented as triagles (filled or unfilled). They have a name, a color, an orientation, and location. The location determines the position of the point of the marker and the orientation the location of the other vertices of the marker triangle relative to the location.

OPTIONS

-plot plotchart-object

This option is mandatory at construction time and is the Plotchart id of the plot on which the marker should be displayed. Once the marker is constructed, this option is readonly.

-size pixels

The size of the leg of the triangle in pixels. This defaults to 5 which is usually fine.

-direction direction-indicator

Indicates the orientation of the marker's 'point'. This can be one of right, left, up, or down.

The default vale is right which means that the remaining vertices of the triangle will be drawn to the left of the marker's position.

color color-spec

Specifies the outline color and, if the marker is drawn filled, the fill color of the marker. This defaults to black. The color can be specified using any form that is valid for the color of an object on a canvas.

-filled boolean

If the value of this option is true (using any of the boolean true values Tcl supports), the marker is drawn as a filled rectangle. If false the marker is only drawn as an outline.

METHODS

Once created, markers have the following methods (subcommands):

drawAt x y

Draws the marker at the world coordinates x, y. This is implemented by destroying the canvas object and making a new one at the requested position.

moveTo x y

Moves the marker to the world coordinates specified by x, y. This is implemented by using the move subcommand of the underlying canvas.

coords

Returns a two element list containing the world coordinate position of the marker's pointer. The first list element is the X coordinate, the second is the Y