O'Reilly logo

Tcl/Tk in a Nutshell by Paul Raines, Jeff Tranter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

graph

graph pathName [option value...]stripchart pathName [option value...]barchart pathName [option value...]

BLT supports three types of charts with the graph, stripchart, and barchart commands. The methods and options for each of these widgets are nearly identical; therefore, all three are described here with the differences noted as appropriate.

The graph command creates a new graph widget named pathName for plotting two-dimensional data (x- and y-coordinates) using symbols and/or connecting lines. A graph widget is composed of several components: coordinate axes, data elements, a legend, a grid, crosshairs, pens, a PostScript generator, and annotation markers. Methods exist for creating (if necessary) and manipulating each of these components.

The stripchart command creates a new strip chart widget named pathName. A strip chart widget is almost exactly the same as a graph widget except that the x-axis typically refers to time points and has better support for maintaining a view of recent data. The primary difference is support for the -autorange and -shiftby axis options.

The barchart command creates a new bar chart widget named pathName. A bar chart widget is essentially the same as a graph widget except that vertical bars are used to represent the data rather than symbols and lines. Therefore the bar chart has very different element and pen configuration options. It also supports the additions to the axis configuration used by the strip chart to handle dynamic data.

Any number ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required