OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / CELLLINUX64 / util / CELLLINUX64 / man / mann / barchart.n
1 '\"
2 '\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
3 '\"
4 '\" Permission to use, copy, modify, and distribute this software and its
5 '\" documentation for any purpose and without fee is hereby granted, provided
6 '\" that the above copyright notice appear in all copies and that both that the
7 '\" copyright notice and warranty disclaimer appear in supporting documentation,
8 '\" and that the names of Lucent Technologies any of their entities not be used
9 '\" in advertising or publicity pertaining to distribution of the software
10 '\" without specific, written prior permission.
11 '\"
12 '\" Lucent Technologies disclaims all warranties with regard to this software,
13 '\" including all implied warranties of merchantability and fitness.  In no event
14 '\" shall Lucent Technologies be liable for any special, indirect or
15 '\" consequential damages or any damages whatsoever resulting from loss of use,
16 '\" data or profits, whether in an action of contract, negligence or other
17 '\" tortuous action, arising out of or in connection with the use or performance
18 '\" of this software.  
19 '\"
20 '\" Barchart widget created by Sani Nassif and George Howlett.
21 '\"
22 '\" The definitions below are for supplemental macros used in Tcl/Tk
23 '\" manual entries.
24 '\"
25 '\" .AP type name in/out ?indent?
26 '\"     Start paragraph describing an argument to a library procedure.
27 '\"     type is type of argument (int, etc.), in/out is either "in", "out",
28 '\"     or "in/out" to describe whether procedure reads or modifies arg,
29 '\"     and indent is equivalent to second arg of .IP (shouldn't ever be
30 '\"     needed;  use .AS below instead)
31 '\"
32 '\" .AS ?type? ?name?
33 '\"     Give maximum sizes of arguments for setting tab stops.  Type and
34 '\"     name are examples of largest possible arguments that will be passed
35 '\"     to .AP later.  If args are omitted, default tab stops are used.
36 '\"
37 '\" .BS
38 '\"     Start box enclosure.  From here until next .BE, everything will be
39 '\"     enclosed in one large box.
40 '\"
41 '\" .BE
42 '\"     End of box enclosure.
43 '\"
44 '\" .CS
45 '\"     Begin code excerpt.
46 '\"
47 '\" .CE
48 '\"     End code excerpt.
49 '\"
50 '\" .VS ?version? ?br?
51 '\"     Begin vertical sidebar, for use in marking newly-changed parts
52 '\"     of man pages.  The first argument is ignored and used for recording
53 '\"     the version when the .VS was added, so that the sidebars can be
54 '\"     found and removed when they reach a certain age.  If another argument
55 '\"     is present, then a line break is forced before starting the sidebar.
56 '\"
57 '\" .VE
58 '\"     End of vertical sidebar.
59 '\"
60 '\" .DS
61 '\"     Begin an indented unfilled display.
62 '\"
63 '\" .DE
64 '\"     End of indented unfilled display.
65 '\"
66 '\" .SO
67 '\"     Start of list of standard options for a Tk widget.  The
68 '\"     options follow on successive lines, in four columns separated
69 '\"     by tabs.
70 '\"
71 '\" .SE
72 '\"     End of list of standard options for a Tk widget.
73 '\"
74 '\" .OP cmdName dbName dbClass
75 '\"     Start of description of a specific option.  cmdName gives the
76 '\"     option's name as specified in the class command, dbName gives
77 '\"     the option's name in the option database, and dbClass gives
78 '\"     the option's class in the option database.
79 '\"
80 '\" .UL arg1 arg2
81 '\"     Print arg1 underlined, then print arg2 normally.
82 '\"
83 '\" RCS: @(#) $Id: man.macros,v 1.3 2001/02/17 07:46:19 ghowlett Exp $
84 '\"
85 '\"     # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
86 .if t .wh -1.3i ^B
87 .nr ^l \n(.l
88 .ad b
89 '\"     # Start an argument description
90 .de AP
91 .ie !"\\$4"" .TP \\$4
92 .el \{\
93 .   ie !"\\$2"" .TP \\n()Cu
94 .   el          .TP 15
95 .\}
96 .ta \\n()Au \\n()Bu
97 .ie !"\\$3"" \{\
98 \&\\$1  \\fI\\$2\\fP    (\\$3)
99 .\".b
100 .\}
101 .el \{\
102 .br
103 .ie !"\\$2"" \{\
104 \&\\$1  \\fI\\$2\\fP
105 .\}
106 .el \{\
107 \&\\fI\\$1\\fP
108 .\}
109 .\}
110 ..
111 '\"     # define tabbing values for .AP
112 .de AS
113 .nr )A 10n
114 .if !"\\$1"" .nr )A \\w'\\$1'u+3n
115 .nr )B \\n()Au+15n
116 .\"
117 .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
118 .nr )C \\n()Bu+\\w'(in/out)'u+2n
119 ..
120 .AS Tcl_Interp Tcl_CreateInterp in/out
121 '\"     # BS - start boxed text
122 '\"     # ^y = starting y location
123 '\"     # ^b = 1
124 .de BS
125 .br
126 .mk ^y
127 .nr ^b 1u
128 .if n .nf
129 .if n .ti 0
130 .if n \l'\\n(.lu\(ul'
131 .if n .fi
132 ..
133 '\"     # BE - end boxed text (draw box now)
134 .de BE
135 .nf
136 .ti 0
137 .mk ^t
138 .ie n \l'\\n(^lu\(ul'
139 .el \{\
140 .\"     Draw four-sided box normally, but don't draw top of
141 .\"     box if the box started on an earlier page.
142 .ie !\\n(^b-1 \{\
143 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
144 .\}
145 .el \}\
146 \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
147 .\}
148 .\}
149 .fi
150 .br
151 .nr ^b 0
152 ..
153 '\"     # VS - start vertical sidebar
154 '\"     # ^Y = starting y location
155 '\"     # ^v = 1 (for troff;  for nroff this doesn't matter)
156 .de VS
157 .if !"\\$2"" .br
158 .mk ^Y
159 .ie n 'mc \s12\(br\s0
160 .el .nr ^v 1u
161 ..
162 '\"     # VE - end of vertical sidebar
163 .de VE
164 .ie n 'mc
165 .el \{\
166 .ev 2
167 .nf
168 .ti 0
169 .mk ^t
170 \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
171 .sp -1
172 .fi
173 .ev
174 .\}
175 .nr ^v 0
176 ..
177 '\"     # Special macro to handle page bottom:  finish off current
178 '\"     # box/sidebar if in box/sidebar mode, then invoked standard
179 '\"     # page bottom macro.
180 .de ^B
181 .ev 2
182 'ti 0
183 'nf
184 .mk ^t
185 .if \\n(^b \{\
186 .\"     Draw three-sided box if this is the box's first page,
187 .\"     draw two sides but no top otherwise.
188 .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
189 .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
190 .\}
191 .if \\n(^v \{\
192 .nr ^x \\n(^tu+1v-\\n(^Yu
193 \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
194 .\}
195 .bp
196 'fi
197 .ev
198 .if \\n(^b \{\
199 .mk ^y
200 .nr ^b 2
201 .\}
202 .if \\n(^v \{\
203 .mk ^Y
204 .\}
205 ..
206 '\"     # DS - begin display
207 .de DS
208 .RS
209 .nf
210 .sp
211 ..
212 '\"     # DE - end display
213 .de DE
214 .fi
215 .RE
216 .sp
217 ..
218 '\"     # SO - start of list of standard options
219 .de SO
220 .SH "STANDARD OPTIONS"
221 .LP
222 .nf
223 .ta 4c 8c 12c
224 .ft B
225 ..
226 '\"     # SE - end of list of standard options
227 .de SE
228 .fi
229 .ft R
230 .LP
231 See the \\fBoptions\\fR manual entry for details on the standard options.
232 ..
233 '\"     # OP - start of full description for a single option
234 .de OP
235 .LP
236 .nf
237 .ta 4c
238 Command-Line Name:      \\fB\\$1\\fR
239 Database Name:  \\fB\\$2\\fR
240 Database Class: \\fB\\$3\\fR
241 .fi
242 .IP
243 ..
244 '\"     # CS - begin code excerpt
245 .de CS
246 .RS
247 .nf
248 .ta .25i .5i .75i 1i
249 .ft CW
250 .sp
251 ..
252 '\"     # CE - end code excerpt
253 .de CE
254 .fi
255 .RE
256 .ft R
257 .sp
258 ..
259 .de UL
260 \\$1\l'|0\(ul'\\$2
261 ..
262 .TH barchart n 2.4 BLT "BLT Built-In Commands"
263 .BS
264 '\" Note:  do not modify the .SH NAME line immediately below!
265 .SH NAME
266 barchart \-  Bar chart for plotting X-Y coordinate data.
267 .SH SYNOPSIS
268 \fBbarchart\fI \fIpathName \fR?\fIoption value\fR?...
269 .BE
270 .SH DESCRIPTION
271 The \fBbarchart\fR command creates a bar chart for plotting
272 two-dimensional data (X-Y coordinates). A bar chart is a graphic means
273 of comparing numbers by displaying bars of lengths proportional to the
274 y-coordinates of the points they represented.  The bar chart has many
275 configurable components: coordinate axes, elements, legend, grid
276 lines, cross hairs, etc.  They allow you to customize the look and
277 feel of the graph.
278 .SH INTRODUCTION
279 The \fBbarchart\fR command creates a new window for plotting
280 two-dimensional data (X-Y coordinates), using bars of
281 various lengths to represent the data points.  The bars are drawn in a
282 rectangular area displayed in the center of the new window.  This is the
283 \fIplotting area\fR.  The coordinate axes are drawn in
284 the margins surrounding the plotting area.  By default, the legend is
285 drawn in the right margin.  The title is displayed in top margin.
286 .PP
287 A \fBbarchart\fR widget has several configurable components:
288 coordinate axes, data elements, legend, grid, cross hairs, pens,
289 postscript, and annotation markers.  Each component can be queried or
290 modified.
291 .TP 1i
292 \f(CWaxis\fR 
293
294 Up to four coordinate axes (two X\-coordinate and two Y\-coordinate
295 axes) can be displayed, but you can create and use any number of
296 axes. Axes control what region of data is displayed and how the data
297 is scaled. Each axis consists of the axis line, title, major and minor
298 ticks, and tick labels. Tick labels display the value at each major
299 tick.
300 .TP 1i
301 \f(CWcrosshairs\fR 
302 Cross hairs are used to position the mouse pointer relative to the X
303 and Y coordinate axes. Two perpendicular lines, intersecting at the
304 current location of the mouse, extend across the plotting area to the
305 coordinate axes.
306 .TP 1i
307 \f(CWelement\fR 
308 An element represents a set of data to be plotted.  It contains an x
309 and y vector of values representing the data points.  Each
310 data point is displayed as a bar where the length of the bar is
311 proportional to the ordinate (Y-coordinate) of the data point.
312 The appearance of the bar, such as its color, stipple, or relief
313 is configurable.
314 .sp
315 A special case exists when two or more data points have the same
316 abscissa (X-coordinate).  By default, the bars are overlayed, one on
317 top of the other.  The bars are drawn in the order of the element
318 display list.  But you can also configure the bars to be displayed in
319 two other ways.  They may be displayed as a stack, where each bar
320 (with the same abscissa) is stacked on the previous.  Or they can be
321 drawn side-by-side as thin bars.  The width of each bar is a function
322 of the number of data points with the same abscissa.
323 .TP 1i
324 \f(CWgrid\fR
325 Extends the major and minor ticks of the X\-axis and/or Y\-axis across the 
326 plotting area. 
327 .TP 1i
328 \f(CWlegend\fR 
329 The legend displays the name and symbol of each data element. 
330 The legend can be drawn in any margin or in the plotting area.
331 .TP 1i
332 \f(CWmarker\fR
333 Markers are used annotate or highlight areas of the graph. For
334 example, you could use a text marker to label a particular data
335 point. Markers come in various forms: text strings, bitmaps, connected
336 line segments, images, polygons, or embedded widgets.
337 .TP 1i
338 \f(CWpen\fR 
339 Pens define attributes for elements.  Data elements use pens to
340 specify how they should be drawn.  A data element may use many pens at
341 once.  Here the particular pen used for a data point is determined
342 from each element's weight vector (see the element's \fB\-weight\fR
343 and \fB\-style\fR options).
344 .TP 1i
345 \f(CWpostscript\fR
346 The widget can generate encapsulated PostScript output. This component
347 has several options to configure how the PostScript is generated.
348 .SH SYNTAX
349 .DS
350 \fBbarchart \fIpathName \fR?\fIoption value\fR?...
351 .DE
352 The \fBbarchart\fR command creates a new window \fIpathName\fR and makes
353 it into a \fBbarchart\fR widget.  At the time this command is invoked, there
354 must not exist a window named \fIpathName\fR, but \fIpathName\fR's
355 parent must exist.  Additional options may be specified on the
356 command line or in the option database to configure aspects of the
357 graph such as its colors and font.  See the \fBconfigure\fR operation
358 below for the exact details about what \fIoption\fR and \fIvalue\fR
359 pairs are valid.
360 .PP
361 If successful, \fBbarchart\fR returns the path name of the widget.  It
362 also creates a new Tcl command by the same name.  You can use this
363 command to invoke various operations that query or modify the graph.
364 The general form is:
365 .DS
366 \fIpathName \fIoperation\fR \fR?\fIarg\fR?...
367 .DE
368 Both \fIoperation\fR and its arguments determine the exact behavior of
369 the command.  The operations available for the graph are described in 
370 the 
371 .SB "BARCHART OPERATIONS"
372 section.
373 .PP
374 The command can also be used to access components of the graph.
375 .DS
376 \fIpathName component operation\fR ?\fIarg\fR?...
377 .DE
378 The operation, now located after the name of the component, is the
379 function to be performed on that component. Each component has its own
380 set of operations that manipulate that component.  They will be
381 described below in their own sections.
382 .SH EXAMPLE
383 The \fBbarchart\fR command creates a new bar chart.  
384 .CS
385 # Create a new bar chart.  Plotting area is black.
386 barchart .b -plotbackground black
387 .CE
388 A new Tcl command \f(CW.b\fR is created.  This command can be used
389 to query and modify the bar chart.  For
390 example, to change the title of the graph to "My Plot", you use the
391 new command and the \fBconfigure\fR operation.
392 .CS
393 # Change the title.
394 \&.b configure -title "My Plot"
395 .CE
396 To add data elements, you use the command and the \fBelement\fR component.
397 .CS
398 # Create a new element named "e1"
399 \&.b element create e1 \\
400         -xdata { 1 2 3 4 5 6 7 8 9 10 } \\
401         -ydata { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 
402                 155.85 166.60 175.38 }
403 .CE
404 The element's X-Y coordinates are specified using lists of
405 numbers.  Alternately, BLT vectors could be used to hold the X-Y
406 coordinates.
407 .CS
408 # Create two vectors and add them to the barchart.
409 vector xVector yVector
410 xVector set { 1 2 3 4 5 6 7 8 9 10 }
411 yVector set { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 155.85 
412         166.60 175.38 }
413 \&n.b element create e1 -xdata xVector -ydata yVector
414 .CE
415 The advantage of using vectors is that when you modify one, the graph
416 is automatically redrawn to reflect the new values.
417 .CS
418 # Change the y coordinate of the first point.
419 set yVector(0) 25.18
420 .CE
421 An element named \f(CWe1\fR is now created in \f(CW.b\fR.  It 
422 is automatically added to the display list of elements.  You can
423 use this list to control in what order elements are displayed.
424 To query or reset the element display list, you use the element's 
425 \fBshow\fR operation.
426 .CS
427 # Get the current display list 
428 set elemList [.b element show]
429 # Remove the first element so it won't be displayed.
430 \&.b element show [lrange $elemList 0 end]
431 .CE
432 The element will be displayed by as many bars as there are data points
433 (in this case there are ten).  The bars will be drawn centered at the
434 x-coordinate of the data point.  All the bars will have the same
435 attributes (colors, stipple, etc).  The width of each bar is by
436 default one unit.  You can change this with using the \fB\-barwidth\fR
437 option.
438 .CS
439 # Change the scale of the x-coordinate data 
440 xVector set { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 }
441 # Make sure we change the bar width too.
442 \&.b configure -barwidth 0.2
443 .CE
444 The height of each bar is proportional to the ordinate (Y-coordinate)
445 of the data point.
446 .PP
447 If two or more data points have the same abscissa (X-coordinate
448 value), the bars representing those data points may be drawn in 
449 various ways.
450 The default is to overlay the bars, one on top of the other.
451 The ordering is determined from the of element display list.  If
452 the stacked mode is selected (using the \fB\-barmode\fR configuration
453 option), the bars are stacked, each bar above the previous.
454 .CS
455 # Display the elements as stacked.
456 \&.b configure -barmode stacked
457 .CE
458 If the aligned mode is selected, the bars having the same
459 x-coordinates are displayed side by side.  The width of each bar is a
460 fraction of its normal width, based upon the number of bars with the
461 same x-coordinate.
462 .CS
463 # Display the elements side-by-side.
464 \&.b configure -barmode aligned
465 .CE
466 By default, the element's label in the legend will be also
467 \f(CWe1\fR.  You can change the label, or specify no legend entry,
468 again using the element's \fBconfigure\fR operation.
469 .CS
470 # Don't display "e1" in the legend.
471 \&.b element configure e1 -label ""
472 .CE
473 You can configure more than just the element's label.  An element has
474 many attributes such as stipple, foreground and background colors,
475 relief, etc.
476 .CS
477 \&.b element configure e1 -fg red -bg pink \\
478         -stipple gray50
479 .CE
480 Four coordinate axes are automatically created: \f(CWx\fR, \f(CWx2\fR,
481 \f(CWy\fR, and \f(CWy2\fR.  And by default, elements are mapped onto the
482 axes \f(CWx\fR and \f(CWy\fR.  This can be changed with the \fB\-mapx\fR
483 and \fB\-mapy\fR options.
484 .CS
485 # Map "e1" on the alternate y axis "y2".
486 \&.b element configure e1 -mapy y2
487 .CE
488 Axes can be configured in many ways too.  For example, you change the
489 scale of the Y\-axis from linear to log using the \fBaxis\fR component.
490 .CS
491 # Y-axis is log scale.
492 \&.b axis configure y -logscale yes
493 .CE
494 One important way axes are used is to zoom in on a particular data
495 region.  Zooming is done by simply specifying new axis limits using
496 the \fB\-min\fR and \fB\-max\fR configuration options.
497 .CS
498 \&.b axis configure x \-min 1.0 \-max 1.5
499 \&.b axis configure y \-min 12.0 \-max 55.15
500 .CE
501 To zoom interactively, you link the\fBaxis configure\fR operations with
502 some user interaction (such as pressing the mouse button), using the
503 \fBbind\fR command.  To convert between screen and graph coordinates,
504 use the \fBinvtransform\fR operation.
505 .CS
506 # Click the button to set a new minimum 
507 bind .b <ButtonPress-1> { 
508     %W axis configure x \-min [%W axis invtransform x %x]
509     %W axis configure x \-min [%W axis invtransform x %y]
510 }
511 .CE
512 By default, the limits of the axis are determined from data values.
513 To reset back to the default limits, set the \fB\-min\fR and
514 \fB\-max\fR options to the empty value.
515 .CS
516 # Reset the axes to autoscale again.
517 \&.b axis configure x \-min {} \-max {}
518 \&.b axis configure y \-min {} \-max {}
519 .CE
520 By default, the legend is drawn in the right margin.  You can
521 change this or any legend configuration options using the
522 \fBlegend\fR component.
523 .CS
524 # Configure the legend font, color, and relief
525 \&.b legend configure -position left -relief raised \\
526         -font fixed -fg blue
527 .CE
528 To prevent the legend from being displayed, turn on the \fB\-hide\fR
529 option.
530 .CS
531 # Don't display the legend.
532 \&.b legend configure \-hide yes\fR
533 .CE
534 The \fBbarchart\fR has simple drawing procedures called markers.  They can be
535 used to highlight or annotate data in the graph. The types of markers
536 available are bitmaps, polygons, lines, or windows.  Markers can be
537 used, for example, to mark or brush points.  For example there may be
538 a line marker which indicates some low-water value.  Markers are created
539 using the \fBmarker\fR operation.
540 .CS
541 # Create a line represent the low water mark at 10.0
542 \&.b marker create line -name "low_water" \\
543         -coords { -Inf 10.0 Inf 10.0 } \\
544         -dashes { 2 4 2 } -fg red -bg blue 
545 .CE
546 This creates a line marker named \f(CWlow_water\fR.  It will display a
547 horizontal line stretching across the plotting area at the
548 y-coordinate 10.0.  The coordinates "-Inf" and "Inf" indicate the
549 relative minimum and maximum of the axis (in this case the x-axis).  By
550 default, markers are drawn last, on top of the bars.  You can change this
551 with the \fB\-under\fR option.
552 .CS
553 # Draw the marker before elements are drawn.
554 \&.b marker configure low_water -under yes
555 .CE
556 You can add cross hairs or grid lines using the \fBcrosshairs\fR and
557 \fBgrid\fR components.
558 .CS
559 # Display both cross hairs and grid lines.
560 \&.b crosshairs configure -hide no -color red
561 \&.b grid configure -hide no -dashes { 2 2 }
562 .CE
563 Finally, to get hardcopy of the graph, use the \fBpostscript\fR
564 component.
565 .CS
566 # Print the bar chart into file "file.ps"
567 \&.b postscript output file.ps -maxpect yes -decorations no
568 .CE
569 This generates a file \f(CWfile.ps\fR containing the encapsulated
570 PostScript of the graph.  The option \fB\-maxpect\fR says to scale the
571 plot to the size of the page.  Turning off the \fB\-decorations\fR
572 option denotes that no borders or color backgrounds should be
573 drawn (i.e. the background of the margins, legend, and plotting
574 area will be white).
575 .SH SYNTAX
576 .DS
577 \fBbarchart \fIpathName \fR?\fIoption value\fR?...
578 .DE
579 The \fBbarchart\fR command creates a new window \fIpathName\fR and makes
580 it into a barchart widget.  At the time this command is invoked, there
581 must not exist a window named \fIpathName\fR, but \fIpathName\fR's
582 parent must exist.  Additional options may may be specified on the
583 command line or in the option database to configure aspects of the
584 bar chart such as its colors and font.  See the \fBconfigure\fR operation
585 below for the exact details as to what \fIoption\fR and \fIvalue\fR
586 pairs are valid.
587 .PP
588 If successful, \fBbarchart\fR returns \fIpathName\fR. It also creates a
589 new Tcl command \fIpathName\fR.  This command may be used to invoke
590 various operations to query or modify the bar chart.  It has the general
591 form:
592 .DS
593 \fIpathName \fIoperation\fR \fR?\fIarg\fR?...
594 .DE
595 Both \fIoperation\fR and its arguments determine the exact behavior of
596 the command.  The operations available for the bar chart are described in
597 the following section.
598 .SH "BARCHART OPERATIONS"
599 .TP
600 \fIpathName \fBbar \fIelemName \fR?\fIoption value\fR?...
601 Creates a new barchart element \fIelemName\fR.  It's an
602 error if an element \fIelemName\fR already exists.  
603 See the manual for \fBbarchart\fR for details about
604 what \fIoption\fR and \fIvalue\fR pairs are valid.
605 .TP
606 \fIpathName \fBcget\fR \fIoption\fR
607 Returns the current value of the configuration option given by
608 \fIoption\fR.  \fIOption\fR may be any option described
609 below for the \fBconfigure\fR operation.
610 .TP
611 \fIpathName \fBconfigure \fR?\fIoption value\fR?...
612 Queries or modifies the configuration options of the graph.  If
613 \fIoption\fR isn't specified, a list describing the current
614 options for \fIpathName\fR is returned.  If \fIoption\fR is specified,
615 but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
616 If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
617 for each pair, the option \fIoption\fR is set to \fIvalue\fR.
618 The following options are valid.
619 .RS
620 .TP
621 \fB\-background \fIcolor\fR
622 Sets the background color. This includes the margins and
623 legend, but not the plotting area.
624 .TP
625 \fB\-barmode \fImode\fR 
626 Indicates how related bar elements will be drawn.  Related elements
627 have data points with the same abscissas (X-coordinates). \fIMode\fR
628 indicates how those segments should be drawn. \fIMode\fR can be
629 \f(CWinfront\fR, \f(CWaligned\fR, \f(CWoverlap\fR, or \f(CWstacked\fR.
630 The default mode is \f(CWinfront\fR.
631 .RS
632 .TP 1i
633 \f(CWinfront\fR
634 Each successive segment is drawn in front of the previous. 
635 .TP 1i
636 \f(CWstacked\fR
637 Each successive segment is stacked vertically on top of the previous.  
638 .TP 1i
639 \f(CWaligned\fR
640 Segments is displayed aligned from right-to-left.  
641 .TP 1i
642 \f(CWoverlap\fR
643 Like \f(CWaligned\fR but segments slightly overlap each other.  
644 .RE
645 .TP
646 \fB\-barwidth \fIvalue\fR 
647 Specifies the width of the bars.  This value can be overrided by the
648 individual elements using their \fB\-barwidth\fR configuration option.
649 \fIValue\fR is the width in terms of graph coordinates.  The
650 default width is \f(CW1.0\fR.
651 .TP
652 \fB\-borderwidth \fIpixels\fR
653 Sets the width of the 3\-D border around the outside edge of the widget.  The
654 \fB\-relief\fR option determines if the border is to be drawn.  The
655 default is \f(CW2\fR.
656 .TP
657 \fB\-bottommargin \fIpixels\fR
658 Specifies the size of the margin below the X\-coordinate axis.  If
659 \fIpixels\fR is \f(CW0\fR, the size of the margin is selected automatically.
660 The default is \f(CW0\fR.
661 .TP
662 \fB\-bufferelements \fIboolean\fR
663 Indicates whether an internal pixmap to buffer the display of data
664 elements should be used.  If \fIboolean\fR is true, data elements are
665 drawn to an internal pixmap.  This option is especially useful when
666 the graph is redrawn frequently while the remains data unchanged (for
667 example, moving a marker across the plot).  See the
668 .SB "SPEED TIPS"
669 section.
670 The default is \f(CW1\fR.
671 .TP
672 \fB\-cursor \fIcursor\fR
673 Specifies the widget's cursor.  The default cursor is \f(CWcrosshair\fR.
674 .TP
675 \fB\-font \fIfontName\fR 
676 Specifies the font of the graph title. The default is
677 \f(CW*-Helvetica-Bold-R-Normal-*-18-180-*\fR.
678 .TP
679 \fB\-halo \fIpixels\fR 
680 Specifies a maximum distance to consider when searching for the
681 closest data point (see the element's \fBclosest\fR operation below).
682 Data points further than \fIpixels\fR away are ignored.  The default is
683 \f(CW0.5i\fR.
684 .TP
685 \fB\-height \fIpixels\fR
686 Specifies the requested height of widget.  The default is
687 \f(CW4i\fR.
688 .TP
689 \fB\-invertxy \fIboolean\fR
690 Indicates whether the placement X\-axis and Y\-axis should be inverted.  If
691 \fIboolean\fR is true, the X and Y axes are swapped.  The default is
692 \f(CW0\fR.
693 .TP
694 \fB\-justify \fIjustify\fR
695 Specifies how the title should be justified.  This matters only when
696 the title contains more than one line of text. \fIJustify\fR must be
697 \f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR.  The default is
698 \f(CWcenter\fR.
699 .TP
700 \fB\-leftmargin \fIpixels\fR
701 Sets the size of the margin from the left edge of the window to 
702 the Y\-coordinate axis.  If \fIpixels\fR is \f(CW0\fR, the size is
703 calculated automatically.  The default is \f(CW0\fR.
704 .TP
705 \fB\-plotbackground \fIcolor\fR
706 Specifies the background color of the plotting area.  The default is
707 \f(CWwhite\fR.
708 .TP
709 \fB\-plotborderwidth \fIpixels\fR
710 Sets the width of the 3-D border around the plotting area.  The
711 \fB\-plotrelief\fR option determines if a border is drawn.  The
712 default is \f(CW2\fR.
713 .TP
714 \fB\-plotpadx \fIpad\fR
715 Sets the amount of padding to be added to the left and right sides of
716 the plotting area.  \fIPad\fR can be a list of one or two screen
717 distances.  If \fIpad\fR has two elements, the left side of the
718 plotting area entry is padded by the first distance and the right side
719 by the second.  If \fIpad\fR is just one distance, both the left and
720 right sides are padded evenly.  The default is \f(CW8\fR.
721 .TP
722 \fB\-plotpady \fIpad\fR
723 Sets the amount of padding to be added to the top and bottom of the
724 plotting area.  \fIPad\fR can be a list of one or two screen
725 distances.  If \fIpad\fR has two elements, the top of the plotting
726 area is padded by the first distance and the bottom by the second.  If
727 \fIpad\fR is just one distance, both the top and bottom are padded
728 evenly.  The default is \f(CW8\fR.
729 .TP
730 \fB\-plotrelief \fIrelief\fR
731 Specifies the 3-D effect for the plotting area.  \fIRelief\fR
732 specifies how the interior of the plotting area should appear relative
733 to rest of the graph; for example, \f(CWraised\fR means the plot should
734 appear to protrude from the graph, relative to the surface of the
735 graph.  The default is \f(CWsunken\fR.
736 .TP
737 \fB\-relief \fIrelief\fR
738 Specifies the 3-D effect for the barchart widget.  \fIRelief\fR
739 specifies how the graph should appear relative to widget it is packed
740 into; for example, \f(CWraised\fR means the graph should
741 appear to protrude.  The default is \f(CWflat\fR.
742 .TP
743 \fB\-rightmargin \fIpixels\fR
744 Sets the size of margin from the plotting area to the right edge of
745 the window.  By default, the legend is drawn in this margin.  If
746 \fIpixels\fR is than 1, the margin size is selected automatically.
747 .TP
748 \fB\-takefocus\fR \fIfocus\fR 
749 Provides information used when moving the focus from window to window
750 via keyboard traversal (e.g., Tab and Shift-Tab).  If \fIfocus\fR is
751 \f(CW0\fR, this means that this window should be skipped entirely during
752 keyboard traversal.  \f(CW1\fR means that the this window should always
753 receive the input focus.  An empty value means that the traversal
754 scripts make the decision whether to focus on the window.
755 The default is \f(CW""\fR.
756 .TP
757 \fB\-tile \fIimage\fR 
758 Specifies a tiled background for the widget.  If \fIimage\fR isn't
759 \f(CW""\fR, the background is tiled using \fIimage\fR.
760 Otherwise, the normal background color is drawn (see the
761 \fB\-background\fR option).  \fIImage\fR must be an image created
762 using the Tk \fBimage\fR command.  The default is \f(CW""\fR.
763 .TP
764 \fB\-title \fItext\fR 
765 Sets the title to \fItext\fR. If \fItext\fR is \f(CW""\fR,
766 no title will be displayed.
767 .TP
768 \fB\-topmargin \fIpixels\fR
769 Specifies the size of the margin above the x2 axis.  If \fIpixels\fR
770 is \f(CW0\fR, the margin size is calculated automatically.
771 .TP
772 \fB\-width \fIpixels\fR
773 Specifies the requested width of the widget.  The default is
774 \f(CW5i\fR.
775 .RE
776 .TP
777 \fIpathName \fBcrosshairs \fIoperation \fR?\fIarg\fR?
778 See the 
779 .SB "CROSSHAIRS COMPONENT"
780 section.
781 .TP
782 \fIpathName \fBelement \fIoperation \fR?\fIarg\fR?...
783 See the 
784 .SB "ELEMENT COMPONENTS"
785 section.
786 .TP
787 \fIpathName \fBextents \fIitem\fR 
788 Returns the size of a particular item in the graph.  \fIItem\fR must
789 be either \f(CWleftmargin\fR, \f(CWrightmargin\fR, \f(CWtopmargin\fR,
790 \f(CWbottommargin\fR, \f(CWplotwidth\fR, or \f(CWplotheight\fR.
791 .TP
792 \fIpathName \fBgrid \fIoperation \fR?\fIarg\fR?...
793 See the 
794 .SB "GRID COMPONENT"
795 section.
796 .TP
797 \fIpathName \fBinvtransform \fIwinX winY\fR 
798 Performs an inverse coordinate transformation, mapping window
799 coordinates back to graph coordinates, using the standard X\-axis and Y\-axis.
800 Returns a list of containing the X-Y graph coordinates.
801 .TP
802 \fIpathName \fBinside \fIx y\fR
803 Returns \f(CW1\fR is the designated screen coordinate (\fIx\fR and \fIy\fR)
804 is inside the plotting area and \f(CW0\fR otherwise.
805 .TP
806 \fIpathName \fBlegend \fIoperation \fR?\fIarg\fR?...
807 See the 
808 .SB "LEGEND COMPONENT"
809 section.
810 .TP
811 \fIpathName \fBline\fB operation arg\fR...
812 The operation is the same as \fBelement\fR.
813 .TP
814 \fIpathName \fBmarker \fIoperation \fR?\fIarg\fR?...
815 See the 
816 .SB "MARKER COMPONENTS"
817 section.
818 .TP
819 \fIpathName\fR \fBmetafile\fR ?\fIfileName\fR?
820 \fIThis operation is for Window platforms only\fR.  
821 Creates a Windows enhanced metafile of the barchart.
822 If present, \fIfileName\fR is the file name of the new metafile.
823 Otherwise, the metafile is automatically added to the clipboard.
824 .TP
825 \fIpathName \fBpostscript \fIoperation \fR?\fIarg\fR?...
826 See the 
827 .SB "POSTSCRIPT COMPONENT"
828 section.
829 .TP
830 \fIpathName \fBsnap \fIphotoName\fR
831 Takes a snapshot of the graph and stores the contents in the photo
832 image \fIphotoName\fR.  \fIPhotoName\fR is the name of a Tk photo
833 image that must already exist.
834 .TP
835 \fIpathName \fBtransform \fIx y\fR 
836 Performs a coordinate transformation, mapping graph coordinates to
837 window coordinates, using the standard X\-axis and Y\-axis.
838 Returns a list containing the X\-Y screen coordinates.
839 .TP
840 \fIpathName \fBxaxis \fIoperation\fR ?\fIarg\fR?...
841 .TP
842 \fIpathName \fBx2axis \fIoperation\fR ?\fIarg\fR?... 
843 .TP
844 \fIpathName \fByaxis \fIoperation\fR ?\fIarg\fR?... 
845 .TP
846 \fIpathName \fBy2axis \fIoperation\fR ?\fIarg\fR?... 
847 See the 
848 .SB "AXIS COMPONENTS"
849 section.
850 .SH "BARCHART COMPONENTS"
851 A graph is composed of several components: coordinate axes, data
852 elements, legend, grid, cross hairs, postscript, and annotation
853 markers. Instead of one big set of configuration options and
854 operations, the graph is partitioned, where each component has its own
855 configuration options and operations that specifically control that
856 aspect or part of the graph. 
857 .SS "AXIS COMPONENTS"
858 Four coordinate axes are automatically created: two X\-coordinate axes
859 (\f(CWx\fR and \f(CWx2\fR) and two Y\-coordinate axes (\f(CWy\fR, and
860 \f(CWy2\fR).  By default, the axis \f(CWx\fR is located in the bottom
861 margin, \f(CWy\fR in the left margin, \f(CWx2\fR in the top margin, and
862 \f(CWy2\fR in the right margin.
863 .PP
864 An axis consists of the axis line, title, major and minor ticks, and
865 tick labels.  Major ticks are drawn at uniform intervals along the
866 axis.  Each tick is labeled with its coordinate value.  Minor ticks
867 are drawn at uniform intervals within major ticks.  
868 .PP
869 The range of the axis controls what region of data is plotted.
870 Data points outside the minimum and maximum limits of the axis are
871 not plotted.  By default, the minimum and maximum limits are
872 determined from the data, but you can reset either limit.
873 .PP
874 You can create and use several axes. To create an axis, invoke
875 the axis component and its create operation.
876 .CS
877 # Create a new axis called "temperature"
878 \&.b axis create temperature
879 .CE
880 You map data elements to an axis using the element's \-mapy and \-mapx
881 configuration options. They specify the coordinate axes an element
882 is mapped onto.
883 .CS
884 # Now map the temperature data to this axis.
885 \&.b element create "temp" \-xdata $x \-ydata $tempData \\
886     \-mapy temperature
887 .CE
888 While you can have many axes, only four axes can be displayed
889 simultaneously.  They are drawn in each of the margins surrounding
890 the plotting area.  The axes \f(CWx\fR and \f(CWy\fR are drawn in the
891 bottom and left margins. The axes \f(CWx2\fR and \f(CWy2\fR are drawn in
892 top and right margins.  Only \f(CWx\fR and \f(CWy\fR are shown by
893 default. Note that the axes can have different scales.
894 .PP
895 To display a different axis, you invoke one of the following
896 components: \fBxaxis\fR, \fByaxis\fR, \fBx2axis\fR, and \fBy2axis\fR.
897 The \fBuse\fR operation designates the axis to be drawn in the
898 corresponding margin: \fBxaxis\fR in the bottom, \fByaxis\fR in the left, 
899 \fBx2axis\fR in the top, and \fBy2axis\fR in the right.
900 .CS
901 # Display the axis temperature in the left margin.
902 \&.b yaxis use temperature
903 .CE
904 .PP
905 You can configure axes in many ways. The axis scale can be linear or
906 logarithmic.  The values along the axis can either monotonically
907 increase or decrease.  If you need custom tick labels, you can specify
908 a Tcl procedure to format the label any way you wish.  You can
909 control how ticks are drawn, by changing the major tick interval
910 or the number of minor ticks.  You can define non-uniform tick intervals,
911 such as for time-series plots.
912 .PP
913 .TP
914 \fIpathName \fBaxis \fBcget \fIaxisName \fIoption\fR
915 Returns the current value of the option given by \fIoption\fR for
916 \fIaxisName\fR.  \fIOption\fR may be any option described below
917 for the axis \fBconfigure\fR operation.
918 .TP
919 \fIpathName \fBaxis \fBconfigure \fIaxisName \fR?\fIaxisName\fR?... ?\fIoption value\fR?...
920 Queries or modifies the configuration options of \fIaxisName\fR.
921 Several axes can be changed.  If \fIoption\fR isn't specified, a list
922 describing all the current options for \fIaxisName\fR is returned.  If
923 \fIoption\fR is specified, but not \fIvalue\fR, then a list describing
924 \fIoption\fR is returned.  If one or more \fIoption\fR and \fIvalue\fR
925 pairs are specified, then for each pair, the axis option \fIoption\fR
926 is set to \fIvalue\fR.  The following options are valid for axes.
927 .RS
928 .TP
929 \fB\-autorange \fIrange\fR 
930 Sets the range of values for the axis to \fIrange\fR.  The axis limits
931 are automatically reset to display the most recent data points in this range.  
932 If \fIrange\fR is 0.0, the range is
933 determined from the limits of the data.  If \fB\-min\fR or \fB-max\fR
934 are specified, they override this option.  The default is \f(CW0.0\fR.
935 .TP
936 \fB\-color \fIcolor\fR
937 Sets the color of the axis and tick labels.
938 The default is \f(CWblack\fR.
939 .TP
940 \fB\-command \fIprefix\fR
941 Specifies a Tcl command to be invoked when formatting the axis tick
942 labels. \fIPrefix\fR is a string containing the name of a Tcl proc and
943 any extra arguments for the procedure.  This command is invoked for each
944 major tick on the axis.  Two additional arguments are passed to the
945 procedure: the pathname of the widget and the current the numeric
946 value of the tick.  The procedure returns the formatted tick label.  If
947 \f(CW""\fR is returned, no label will appear next to the tick.  You can
948 get the standard tick labels again by setting \fIprefix\fR to
949 \f(CW""\fR.  The default is \f(CW""\fR.
950 .sp 1
951 Please note that this procedure is invoked while the bar chart is redrawn.
952 You may query the widget's configuration options.  But do not reset
953 options, because this can have unexpected results.
954 .TP
955 \fB\-descending \fIboolean\fR 
956 Indicates whether the values along the axis are monotonically increasing or
957 decreasing.  If \fIboolean\fR is true, the axis values will be
958 decreasing.  The default is \f(CW0\fR.
959 .TP
960 \fB\-hide \fIboolean\fR
961 Indicates whether the axis is displayed. 
962 .TP
963 \fB\-justify \fIjustify\fR
964 Specifies how the axis title should be justified.  This matters only
965 when the axis title contains more than one line of text. \fIJustify\fR
966 must be \f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR.  The default is
967 \f(CWcenter\fR.
968 .TP
969 \fB\-limits \fIformatStr\fR
970 Specifies a printf-like description to format the minimum and maximum
971 limits of the axis.  The limits are displayed at the top/bottom or
972 left/right sides of the plotting area.  \fIFormatStr\fR is a list of
973 one or two format descriptions.  If one description is supplied, both
974 the minimum and maximum limits are formatted in the same way.  If two,
975 the first designates the format for the minimum limit, the second for
976 the maximum.  If \f(CW""\fR is given as either description, then 
977 the that limit will not be displayed.  The default is \f(CW""\fR.
978 .TP
979 \fB\-linewidth \fIpixels\fR
980 Sets the width of the axis and tick lines.  The default is \f(CW1\fR
981 pixel.
982 .TP
983 \fB\-logscale \fIboolean\fR
984 Indicates whether the scale of the axis is logarithmic or linear.  If
985 \fIboolean\fR is true, the axis is logarithmic.  The default scale is
986 linear.
987 .TP
988 \fB\-loose \fIboolean\fR
989 Indicates whether the limits of the axis should fit the data points tightly,
990 at the outermost data points, or loosely, at the outer tick intervals.
991 This is relevant only when the axis limit is automatically calculated.
992 If \fIboolean\fR is true, the axis range is "loose".
993 The default is \f(CW0\fR.
994 .TP
995 \fB\-majorticks \fImajorList\fR
996 Specifies where to display major axis ticks.  You can use this option
997 to display ticks at non-uniform intervals.  \fIMajorList\fR is a list
998 of axis coordinates designating the location of major ticks.  No
999 minor ticks are drawn.  If \fImajorList\fR is \f(CW""\fR, 
1000 major ticks will be automatically computed. The default is \f(CW""\fR.
1001 .TP
1002 \fB\-max \fIvalue\fR
1003 Sets the maximum limit of \fIaxisName\fR.  Any data point greater 
1004 than \fIvalue\fR is not displayed.  If \fIvalue\fR is \f(CW""\fR, 
1005 the maximum limit is calculated using the largest data value.
1006 The default is \f(CW""\fR.
1007 .TP
1008 \fB\-min \fIvalue\fR
1009 Sets the minimum limit of \fIaxisName\fR. Any data point less than 
1010 \fIvalue\fR is not displayed.  If \fIvalue\fR is \f(CW""\fR,
1011 the minimum limit is calculated using the smallest data value.
1012 The default is \f(CW""\fR.
1013 .TP
1014 \fB\-minorticks \fIminorList\fR
1015 Specifies where to display minor axis ticks.  You can use this option
1016 to display minor ticks at non-uniform intervals. \fIMinorList\fR is a
1017 list of real values, ranging from 0.0 to 1.0, designating the placement of
1018 a minor tick.  No minor ticks are drawn if the \fB\-majortick\fR
1019 option is also set.  If \fIminorList\fR is \f(CW""\fR, minor ticks will
1020 be automatically computed. The default is \f(CW""\fR.
1021 .TP
1022 \fB\-rotate \fItheta\fR
1023 Specifies the how many degrees to rotate the axis tick labels.
1024 \fITheta\fR is a real value representing the number of degrees
1025 to rotate the tick labels.  The default is \f(CW0.0\fR degrees.
1026 .TP
1027 \fB\-shiftby \fIvalue\fR
1028 Specifies how much to automatically shift the range of the axis.
1029 When the new data exceeds the current axis maximum, the maximum
1030 is increased in increments of \fIvalue\fR.  You can use this
1031 option to prevent the axis limits from being recomputed
1032 at each new time point. If \fIvalue\fR is 0.0, then no automatic
1033 shifting is down. The default is \f(CW0.0\fR.
1034 .TP
1035 \fB\-showticks \fIboolean\fR
1036 Indicates whether axis ticks should be drawn. If \fIboolean\fR is
1037 true, ticks are drawn.  If false, only the
1038 axis line is drawn. The default is \f(CW1\fR.
1039 .TP
1040 \fB\-stepsize \fIvalue\fR
1041 Specifies the interval between major axis ticks.  If \fIvalue\fR isn't
1042 a valid interval (must be less than the axis range), 
1043 the request is ignored and the step size is automatically calculated.
1044 .TP
1045 \fB\-subdivisions \fInumber\fR 
1046 Indicates how many minor axis ticks are
1047 to be drawn.  For example, if \fInumber\fR is two, only one minor
1048 tick is drawn.  If \fInumber\fR is one, no minor ticks are
1049 displayed.  The default is \f(CW2\fR.
1050 .TP
1051 \fB\-tickfont \fIfontName\fR 
1052 Specifies the font for axis tick labels. The default is
1053 \f(CW*-Courier-Bold-R-Normal-*-100-*\fR.
1054 .TP
1055 \fB\-ticklength \fIpixels\fR
1056 Sets the length of major and minor ticks (minor ticks are half the
1057 length of major ticks). If \fIpixels\fR is less than zero, the axis
1058 will be inverted with ticks drawn pointing towards the plot.  The
1059 default is \f(CW0.1i\fR.
1060 .TP
1061 \fB\-title \fItext\fR
1062 Sets the title of the axis. If \fItext\fR is 
1063 \f(CW""\fR, no axis title will be displayed.  
1064 .TP
1065 \fB\-titlecolor \fIcolor\fR
1066 Sets the color of the axis title. The default is \f(CWblack\fR.
1067 .TP
1068 \fB\-titlefont \fIfontName\fR 
1069 Specifies the font for axis title. The default is
1070 \f(CW*-Helvetica-Bold-R-Normal-*-14-140-*\fR.
1071 .PP
1072 Axis configuration options may be also be set by the \fBoption\fR
1073 command.  The resource class is \f(CWAxis\fR.  The resource names
1074 are the names of the axes (such as \f(CWx\fR or \f(CWx2\fR).
1075 .CS
1076 option add *Barchart.Axis.Color  blue
1077 option add *Barchart.x.LogScale  true
1078 option add *Barchart.x2.LogScale false
1079 .CE
1080 .RE
1081 .TP
1082 \fIpathName \fBaxis \fBcreate \fIaxisName \fR?\fIoption value\fR?...
1083 Creates a new axis by the name \fIaxisName\fR.  No axis by the same
1084 name can already exist. \fIOption\fR and \fIvalue\fR are described 
1085 in above in the axis \fBconfigure\fR operation.
1086 .TP
1087 \fIpathName \fBaxis \fBdelete \fR?\fIaxisName\fR?...
1088 Deletes the named axes. An axis is not really
1089 deleted until it is not longer in use, so it's safe to delete
1090 axes mapped to elements.
1091 .TP
1092 \fIpathName \fBaxis invtransform \fIaxisName value\fR
1093 Performs the inverse transformation, changing the screen coordinate
1094 \fIvalue\fR to a graph coordinate, mapping the value mapped to
1095 \fIaxisName\fR.  Returns the graph coordinate.
1096 .TP
1097 \fIpathName \fBaxis limits \fIaxisName\fR
1098 Returns a list of the minimum and maximum limits for \fIaxisName\fR.  The order
1099 of the list is \f(CWmin max\fR.
1100 .TP
1101 \fIpathName \fBaxis names \fR?\fIpattern\fR?...
1102 Returns a list of axes matching zero or more patterns.  If no
1103 \fIpattern\fR argument is give, the names of all axes are returned.
1104 .TP
1105 \fIpathName \fBaxis transform \fIaxisName value\fR
1106 Transforms the coordinate \fIvalue\fR to a screen coordinate by mapping
1107 the it to \fIaxisName\fR.  Returns the transformed screen coordinate.
1108 .PP
1109 Only four axes can be displayed simultaneously.  By default, they are
1110 \f(CWx\fR, \f(CWy\fR, \f(CWx2\fR, and \f(CWy2\fR.  You can swap in a different
1111 axis with \fBuse\fR operation of the special axis components:
1112 \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, and \fBy2axis\fR.
1113 .CS
1114 \&.g create axis temp
1115 \&.g create axis time
1116 \&...
1117 \&.g xaxis use temp
1118 \&.g yaxis use time
1119 .CE
1120 Only the axes specified for use are displayed on the screen.
1121 .PP
1122 The \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, and \fBy2axis\fR
1123 components operate on an axis location rather than a specific axis
1124 like the more general \fBaxis\fR component does.  The \fBxaxis\fR
1125 component manages the X-axis located in the bottom margin (whatever
1126 axis that happens to be).  Likewise, \fByaxis\fR uses the Y-axis in
1127 the left margin, \fBx2axis\fR the top X-axis, and \fBy2axis\fR the
1128 right Y-axis.
1129 .PP
1130 They implicitly control the axis that is currently using to that
1131 location.  By default, \fBxaxis\fR uses the \f(CWx\fR axis, \fByaxis\fR
1132 uses \f(CWy\fR, \fBx2axis\fR uses \f(CWx2\fR, and \fBy2axis\fR uses
1133 \f(CWy2\fR.  These components can be more convenient to use than always
1134 determining what axes are current being displayed by the graph.
1135 .PP
1136 The following operations are available for axes. They mirror exactly
1137 the operations of the \fBaxis\fR component.  The \fIaxis\fR argument
1138 must be \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, or \fBy2axis\fR.
1139 .TP
1140 \fIpathName \fIaxis \fBcget \fIoption\fR
1141 .TP
1142 \fIpathName \fIaxis \fBconfigure \fR?\fIoption value\fR?...
1143 .TP
1144 \fIpathName \fIaxis\fB invtransform \fIvalue\fR
1145 .TP
1146 \fIpathName \fIaxis \fBlimits\fR
1147 .TP
1148 \fIpathName \fIaxis\fB transform \fIvalue\fR
1149 .TP
1150 \fIpathName \fIaxis\fB use \fR?\fIaxisName\fR?  
1151 Designates the axis \fIaxisName\fR is to be displayed at this
1152 location.  \fIAxisName\fR can not be already in use at another location.  
1153 This command returns the name of the axis currently using this location.
1154 .SS "CROSSHAIRS COMPONENT"
1155 Cross hairs consist of two intersecting lines (one vertical and one horizontal)
1156 drawn completely across the plotting area.  They are used to position
1157 the mouse in relation to the coordinate axes.  Cross hairs differ from line
1158 markers in that they are implemented using XOR drawing primitives.
1159 This means that they can be quickly drawn and erased without redrawing
1160 the entire widget.
1161 .PP
1162 The following operations are available for cross hairs:
1163 .TP
1164 \fIpathName \fBcrosshairs cget \fIoption\fR
1165 Returns the current value of the cross hairs configuration option
1166 given by \fIoption\fR.  \fIOption\fR may be any option
1167 described below for the cross hairs \fBconfigure\fR operation.
1168 .TP
1169 \fIpathName \fBcrosshairs configure \fR?\fIoption value\fR?...  
1170 Queries or modifies the configuration options of the cross hairs.  If
1171 \fIoption\fR isn't specified, a list describing all the current
1172 options for the cross hairs is returned.  If \fIoption\fR is specified,
1173 but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
1174 If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
1175 for each pair, the cross hairs option \fIoption\fR is set to
1176 \fIvalue\fR.
1177 The following options are available for cross hairs.
1178 .RS
1179 .TP
1180 \fB\-color \fIcolor\fR 
1181 Sets the color of the cross hairs.  The default is \f(CWblack\fR.
1182 .TP
1183 \fB\-dashes \fIdashList\fR
1184 Sets the dash style of the cross hairs. \fIDashList\fR is a list of up
1185 to 11 numbers that alternately represent the lengths of the dashes
1186 and gaps on the cross hair lines.  Each number must be between 1 and
1187 255.  If \fIdashList\fR is \f(CW""\fR, the cross hairs will be solid
1188 lines.
1189 .TP
1190 \fB\-hide \fIboolean\fR
1191 Indicates whether cross hairs are drawn. If \fIboolean\fR is true,
1192 cross hairs are not drawn.  The default is \f(CWyes\fR.
1193 .TP
1194 \fB\-linewidth \fIpixels\fR
1195 Set the width of the cross hair lines.  The default is \f(CW1\fR.
1196 .TP
1197 \fB\-position \fIpos\fR 
1198 Specifies the screen position where the cross hairs intersect.
1199 \fIPos\fR must be in the form "\fI@x,y\fR", where \fIx\fR and \fIy\fR
1200 are the window coordinates of the intersection.
1201 .PP
1202 Cross hairs configuration options may be also be set by the
1203 \fBoption\fR command.  The resource name and class are
1204 \f(CWcrosshairs\fR and \f(CWCrosshairs\fR respectively.
1205 .CS
1206 option add *Barchart.Crosshairs.LineWidth 2
1207 option add *Barchart.Crosshairs.Color     red
1208 .CE
1209 .RE
1210 .TP
1211 \fIpathName \fBcrosshairs off\fR
1212 Turns off the cross hairs. 
1213 .TP
1214 \fIpathName \fBcrosshairs on\fR
1215 Turns on the display of the cross hairs.
1216 .TP
1217 \fIpathName \fBcrosshairs toggle\fR 
1218 Toggles the current state of the cross hairs, alternately mapping and
1219 unmapping the cross hairs.
1220 .SH "ELEMENTS"
1221 A data element represents a set of data.  It contains x and y vectors
1222 which are the coordinates of the data points.  Elements are displayed
1223 as bars where the length of the bar is proportional to the ordinate of
1224 the data point.  Elements also control the appearance of the data,
1225 such as the color, stipple, relief, etc.
1226 .PP
1227 When new data elements are created, they are automatically added to a
1228 list of displayed elements.   The display list controls what elements
1229 are drawn and in what order.  
1230 .PP
1231 The following operations are available for elements.
1232 .TP
1233 \fIpathName \fBelement activate \fIelemName \fR?\fIindex\fR?...
1234 Specifies the data points of element \fIelemName\fR to be drawn
1235 using active foreground and background colors.  \fIElemName\fR is the
1236 name of the element and \fIindex\fR is a number representing the index
1237 of the data point. If no indices are present then all data points
1238 become active.
1239 .TP
1240 \fIpathName \fBelement bind \fItagName\fR ?\fIsequence\fR?  ?\fIcommand\fR? 
1241 Associates \fIcommand\fR with \fItagName\fR such that whenever the
1242 event sequence given by \fIsequence\fR occurs for an element with this
1243 tag, \fIcommand\fR will be invoked.  The syntax is similar to the 
1244 \fBbind\fR command except that it operates on graph elements, rather 
1245 than widgets. See the \fBbind\fR manual entry for
1246 complete details on \fIsequence\fR and the substitutions performed on 
1247 \fIcommand\fR before invoking it.  
1248 .sp
1249 If all arguments are specified then a new binding is created, replacing 
1250 any existing binding for the same \fIsequence\fR and \fItagName\fR.
1251 If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR 
1252 augments an existing binding rather than replacing it. 
1253 If no \fIcommand\fR argument is provided then the command currently
1254 associated with \fItagName\fR and \fIsequence\fR (it's an error occurs 
1255 if there's no such binding) is returned.  If both \fIcommand\fR and 
1256 \fIsequence\fR are missing then a list of all the event sequences for 
1257 which bindings have been defined for \fItagName\fR. 
1258 .TP
1259 \fIpathName \fBelement cget \fIelemName \fIoption\fR
1260 Returns the current value of the element configuration option given by 
1261 \fIoption\fR.  \fIOption\fR may be any of the options described below
1262 for the element \fBconfigure\fR operation.
1263 .TP
1264 \fIpathName \fBelement closest \fIx y\fR ?\fIoption value\fR?... ?\fIelemName\fR?...
1265 Finds the data point representing the bar closest to the window
1266 coordinates \fIx\fR and \fIy\fR in the element \fIelemName\fR.
1267 \fIElemName\fR is the name of an element, which must be displayed.  If no
1268 elements are specified, then all displayed elements are searched.  It
1269 returns a list containing the name of the closest element, the index
1270 of its closest point, and the graph coordinates of the
1271 point. If no data point within the threshold distance can be found,
1272 \f(CW""\fR is returned.  The following \fIoption\fR-\fIvalue\fR pairs
1273 are available.
1274 .RS
1275 .TP
1276 \fB\-halo \fIpixels\fR
1277 Specifies a threshold distance where selected data points are ignored.
1278 \fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
1279 If this option isn't specified, then it defaults to the value of the
1280 \fBbarchart\fR's \fB\-halo\fR option.
1281 .RE
1282 .TP
1283 \fIpathName \fBelement configure \fIelemName \fR?\fIelemName\fR... ?\fIoption value\fR?...
1284 Queries or modifies the configuration options for elements.  Several
1285 elements can be modified at the same time. If \fIoption\fR isn't
1286 specified, a list describing all the current options for
1287 \fIelemName\fR is returned.  If \fIoption\fR is specified, but not
1288 \fIvalue\fR, then a list describing the option \fIoption\fR is
1289 returned.  If one or more \fIoption\fR and \fIvalue\fR pairs are
1290 specified, then for each pair, the element option \fIoption\fR is set
1291 to \fIvalue\fR.  The following options are valid for elements.
1292 .RS
1293 .TP
1294 \fB\-activepen \fIpenName\fR
1295 Specifies pen to use to draw active element.  If \fIpenName\fR is
1296 \f(CW""\fR, no active elements will be drawn.  The default is 
1297 \f(CWactiveLine\fR.
1298 .TP
1299 \fB\-bindtags \fItagList\fR
1300 Specifies the binding tags for the element.  \fITagList\fR is a list
1301 of binding tag names.  The tags and their order will determine how
1302 events for elements.  Each tag in the list matching the current event
1303 sequence will have its Tcl command executed.  Implicitly the name of
1304 the element is always the first tag in the list.  The default value is
1305 \f(CWall\fR.
1306 .TP
1307 \fB\-background \fIcolor\fR
1308 Sets the the color of the border around each bar.  The default is
1309 \f(CWwhite\fR.
1310 .TP
1311 \fB\-barwidth \fIvalue\fR 
1312 Specifies the width the bars drawn for the element.  \fIValue\fR is
1313 the width in X-coordinates.  If this option isn't
1314 specified, the width of each bar is the value of the widget's
1315 \fB\-barwidth\fR option.
1316 .TP
1317 \fB\-baseline \fIvalue\fR 
1318 Specifies the baseline of the bar segments.  This affects how bars are 
1319 drawn since bars are drawn from their respective y-coordinate the 
1320 baseline. By default the baseline is \f(CW0.0\fR.  
1321 .TP
1322 \fB\-borderwidth \fIpixels\fR
1323 Sets the border width of the 3-D border drawn around the outside of
1324 each bar.  The \fB\-relief\fR option determines if such a border is
1325 drawn.  \fIPixels\fR must be a valid screen distance like \f(CW2\fR or
1326 \f(CW0.25i\fR. The default is \f(CW2\fR.
1327 .TP
1328 \fB\-data \fIcoordList\fR
1329 Specifies the X\-Y coordinates of the data.  \fICoordList\fR is a
1330 list of numeric expressions representing the X\-Y coordinate pairs
1331 of each data point.
1332 .TP
1333 \fB\-foreground \fIcolor\fR 
1334 Sets the color of the interior of the bars.  
1335 .TP
1336 \fB\-hide \fIboolean\fR
1337 Indicates whether the element is displayed.  The default is \f(CWno\fR.
1338 .TP
1339 \fB\-label \fItext\fR
1340 Sets the element's label in the legend.  If \fItext\fR
1341 is \f(CW""\fR, the element will have no entry in the legend.
1342 The default label is the element's name.
1343 .TP
1344 \fB\-mapx \fIxAxis\fR
1345 Selects the X\-axis to map the element's X\-coordinates onto.
1346 \fIXAxis\fR must be the name of an axis.  The default is \f(CWx\fR.
1347 .TP
1348 \fB\-mapy \fIyAxis\fR
1349 Selects the Y\-axis to map the element's Y\-coordinates onto.
1350 \fIYAxis\fR must be the name of an axis. The default is \f(CWy\fR.
1351 .TP
1352 \fB\-relief \fIstring\fR
1353 Specifies the 3-D effect desired for bars.  \fIRelief\fR indicates how
1354 the interior of the bar should appear relative to the surface of the
1355 chart; for example, \f(CWraised\fR means the bar should appear to
1356 protrude from the surface of the plotting area.  The default is
1357 \f(CWraised\fR.
1358 .TP
1359 \fB\-stipple \fIbitmap\fR
1360 Specifies a stipple pattern with which to draw the bars.  If
1361 \fIbitmap\fR is \f(CW""\fR, then the bar is drawn in a solid fashion.
1362 .TP
1363 \fB\-xdata \fIxVector\fR 
1364 Specifies the x-coordinate vector of the data.
1365 \fIXVector\fR is the name of a BLT vector or a
1366 list of numeric expressions.  
1367 .TP
1368 \fB\-ydata \fIyVector\fR 
1369 Specifies the y-coordinate vector of the data.
1370 \fIYVector\fR is the name of a BLT vector or a list of
1371 numeric expressions.  
1372 .PP
1373 Element configuration options may also be set by the 
1374 \fBoption\fR command.  The resource names  in the option database 
1375 are prefixed by \f(CWelem\fR.
1376 .CS
1377 option add *Barchart.Element.background blue
1378 .CE
1379 .RE
1380 .TP
1381 \fIpathName \fBelement create \fIelemName\fR ?\fIoption value\fR?...
1382 Creates a new element \fIelemName\fR.  Element
1383 names must be unique, so an element \fIelemName\fR may not already
1384 exist.  If additional arguments are present, they specify any of the
1385 element options valid for element \fBconfigure\fR operation.
1386 .TP
1387 \fIpathName \fBelement deactivate \fIpattern\fR...
1388 Deactivates all the elements matching \fIpattern\fR for the graph.  
1389 Elements whose names match any of the patterns given are redrawn 
1390 using their normal colors.  
1391 .TP
1392 \fIpathName \fBelement delete\fR ?\fIpattern\fR?...
1393 Deletes all the elements matching \fIpattern\fR for the graph.  
1394 Elements whose names match any of the patterns given are deleted. 
1395 The graph will be redrawn without the deleted elements.  
1396 .TP
1397 \fIpathName \fBelement exists \fIelemName\fR
1398 Returns \f(CW1\fR if an element \fIelemName\fR currently exists and
1399 \f(CW0\fR otherwise.
1400 .TP
1401 \fIpathName \fBelement names \fR?\fIpattern\fR?...  
1402 Returns the elements matching one or more pattern.  If no
1403 \fIpattern\fR is given, the names of all elements is returned.
1404 .TP
1405 \fIpathName \fBelement show\fR ?\fInameList\fR?  
1406 Queries or modifies the element display list.  The element display
1407 list designates the elements drawn and in what
1408 order. \fINameList\fR is a list of elements to be displayed in the
1409 order they are named.  If there is no \fInameList\fR argument,
1410 the current display list is returned.
1411 .TP
1412 \fIpathName \fBelement type\fR \fIelemName\fR
1413 Returns the type of \fIelemName\fR. 
1414 If the element is a bar element, the commands returns the string
1415 \f(CW"bar"\fR, otherwise it returns \f(CW"line"\fR.
1416 .CE
1417 .SS "GRID COMPONENT"
1418 Grid lines extend from the major and minor ticks of each axis
1419 horizontally or vertically across the plotting area.  The following
1420 operations are available for grid lines.
1421 .TP
1422 \fIpathName \fBgrid cget \fIoption\fR
1423 Returns the current value of the grid line configuration option given by 
1424 \fIoption\fR.  \fIOption\fR may be any option described below
1425 for the grid \fBconfigure\fR operation.
1426 .TP
1427 \fIpathName \fBgrid configure\fR ?\fIoption value\fR?...
1428 Queries or modifies the configuration options for grid lines.  If
1429 \fIoption\fR isn't specified, a list describing all the current
1430 grid options for \fIpathName\fR is returned.  If \fIoption\fR is specified,
1431 but not \fIvalue\fR, then a list describing \fIoption\fR is
1432 returned.  If one or more \fIoption\fR and \fIvalue\fR pairs are
1433 specified, then for each pair, the grid line option \fIoption\fR is set to
1434 \fIvalue\fR.  The following options are valid for grid lines.
1435 .RS
1436 .TP
1437 \fB\-color \fIcolor\fR 
1438 Sets the color of the grid lines.  The default is \f(CWblack\fR.
1439 .TP
1440 \fB\-dashes \fIdashList\fR
1441 Sets the dash style of the grid lines. \fIDashList\fR is a list of up
1442 to 11 numbers that alternately represent the lengths of the dashes
1443 and gaps on the grid lines.  Each number must be between 1 and 255.
1444 If \fIdashList\fR is \f(CW""\fR, the grid will be solid lines.
1445 .TP
1446 \fB\-hide \fIboolean\fR
1447 Indicates whether the grid should be drawn. If \fIboolean\fR
1448 is true, grid lines are not shown. The default is \f(CWyes\fR.
1449 .TP
1450 \fB\-linewidth \fIpixels\fR
1451 Sets the width of grid lines.  The default width is \f(CW1\fR.
1452 .TP
1453 \fB\-mapx \fIxAxis\fR
1454 Specifies the X\-axis to display grid lines.  \fIXAxis\fR
1455 must be the name of an axis or \f(CW""\fR for no grid lines.  
1456 The default is \f(CW""\fR.
1457 .TP
1458 \fB\-mapy \fIyAxis\fR
1459 Specifies the Y\-axis to display grid lines.  \fIYAxis\fR
1460 must be the name of an axis or \f(CW""\fR for no grid lines. 
1461 The default is \f(CWy\fR.
1462 .TP
1463 \fB\-minor \fIboolean\fR
1464 Indicates whether the grid lines should be drawn for minor ticks. 
1465 If \fIboolean\fR is true, the lines will appear at
1466 minor tick intervals.  The default is \f(CW1\fR.
1467 .PP
1468 Grid configuration options may also be set by the 
1469 \fBoption\fR command.  The resource name and class are \f(CWgrid\fR and 
1470 \f(CWGrid\fR respectively. 
1471 .CS
1472 option add *Barchart.grid.LineWidth 2
1473 option add *Barchart.Grid.Color     black
1474 .CE
1475 .RE
1476 .TP
1477 \fIpathName \fBgrid off\fR
1478 Turns off the display the grid lines.
1479 .TP
1480 \fIpathName \fBgrid on\fR
1481 Turns on the display the grid lines.
1482 .TP
1483 \fIpathName \fBgrid toggle\fR
1484 Toggles the display of the grid.  
1485 .SS "LEGEND COMPONENT"
1486 The legend displays a list of the data elements.  Each entry consists
1487 of the element's symbol and label.  The legend can appear in any
1488 margin (the default location is in the right margin).  It
1489 can also be positioned anywhere within the plotting area.
1490 .PP
1491 The following operations are valid for the legend.
1492 .TP
1493 \fIpathName \fBlegend activate \fIpattern\fR...
1494 Selects legend entries to be drawn using the active legend colors and relief.
1495 All entries whose element names match \fIpattern\fR  are selected.  To
1496 be selected, the element name must match only one \fIpattern\fR. 
1497 .TP
1498 \fIpathName \fBlegend bind \fItagName\fR ?\fIsequence\fR?  ?\fIcommand\fR? 
1499 Associates \fIcommand\fR with \fItagName\fR such that whenever the
1500 event sequence given by \fIsequence\fR occurs for a legend entry with this
1501 tag, \fIcommand\fR will be invoked.  Implicitly the element names
1502 in the entry are tags.  The syntax is similar to the 
1503 \fBbind\fR command except that it operates on legend entries, rather 
1504 than widgets. See the \fBbind\fR manual entry for
1505 complete details on \fIsequence\fR and the substitutions performed on 
1506 \fIcommand\fR before invoking it.  
1507 .sp
1508 If all arguments are specified then a new binding is created, replacing 
1509 any existing binding for the same \fIsequence\fR and \fItagName\fR.
1510 If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR 
1511 augments an existing binding rather than replacing it. 
1512 If no \fIcommand\fR argument is provided then the command currently
1513 associated with \fItagName\fR and \fIsequence\fR (it's an error occurs 
1514 if there's no such binding) is returned.  If both \fIcommand\fR and 
1515 \fIsequence\fR are missing then a list of all the event sequences for 
1516 which bindings have been defined for \fItagName\fR. 
1517 .TP
1518 \fIpathName \fBlegend cget \fIoption\fR
1519 Returns the current value of a legend configuration option.
1520 \fIOption\fR may be any option described below in the
1521 legend \fBconfigure\fR operation.
1522 .TP
1523 \fIpathName \fBlegend configure \fR?\fIoption value\fR?...
1524 Queries or modifies the configuration options for the legend.  If
1525 \fIoption\fR isn't specified, a list describing the current
1526 legend options for \fIpathName\fR is returned.  If \fIoption\fR is
1527 specified, but not \fIvalue\fR, then a list describing \fIoption\fR is
1528 returned.  If one or more \fIoption\fR and \fIvalue\fR pairs are
1529 specified, then for each pair, the legend option \fIoption\fR is set
1530 to \fIvalue\fR.  The following options are valid for the legend.
1531 .RS
1532 .TP
1533 \fB\-activebackground \fIcolor\fR
1534 Sets the background color for active legend entries.  All legend
1535 entries marked active (see the legend \fBactivate\fR operation) are
1536 drawn using this background color.
1537 .TP
1538 \fB\-activeborderwidth \fIpixels\fR
1539 Sets the width of the 3-D border around the outside edge of the active legend
1540 entries.  The default is \f(CW2\fR.
1541 .TP
1542 \fB\-activeforeground \fIcolor\fR
1543 Sets the foreground color for active legend entries.  All legend
1544 entries marked as active (see the legend \fBactivate\fR operation) are
1545 drawn using this foreground color.
1546 .TP
1547 \fB\-activerelief \fIrelief\fR 
1548 Specifies the 3-D effect desired for active legend entries.
1549 \fIRelief\fR denotes how the interior of the entry should appear
1550 relative to the legend; for example, \f(CWraised\fR means the entry
1551 should appear to protrude from the legend, relative to the surface of
1552 the legend.  The default is \f(CWflat\fR.
1553 .TP
1554 \fB\-anchor \fIanchor\fR
1555 Tells how to position the legend relative to the positioning point for
1556 the legend.  This is dependent on the value of the \fB\-position\fR
1557 option.  The default is \f(CWcenter\fR.
1558 .RS
1559 .TP 1.25i
1560 \f(CWleft\fR or \f(CWright\fR
1561 The anchor describes how to position the legend vertically.  
1562 .TP
1563 \f(CWtop\fR or \f(CWbottom\fR
1564 The anchor describes how to position the legend horizontally.  
1565 .TP
1566 \f(CW@x,y\fR
1567 The anchor specifies how to position the legend relative to the
1568 positioning point. For example, if \fIanchor\fR is \f(CWcenter\fR then
1569 the legend is centered on the point; if \fIanchor\fR is \f(CWn\fR then
1570 the legend will be drawn such that the top center point of the
1571 rectangular region occupied by the legend will be at the positioning
1572 point.
1573 .TP
1574 \f(CWplotarea\fR
1575 The anchor specifies how to position the legend relative to the
1576 plotting area. For example, if \fIanchor\fR is \f(CWcenter\fR then the
1577 legend is centered in the plotting area; if \fIanchor\fR is \f(CWne\fR
1578 then the legend will be drawn such that occupies the upper right
1579 corner of the plotting area.
1580 .RE
1581 .TP
1582 \fB\-background \fIcolor\fR
1583 Sets the background color of the legend. If \fIcolor\fR is \f(CW""\fR,
1584 the legend background with be transparent.
1585 .TP
1586 \fB\-bindtags \fItagList\fR
1587 Specifies the binding tags for legend entries.  \fITagList\fR is a list
1588 of binding tag names.  The tags and their order will determine how
1589 events for legend entries.  Each tag in the list matching the current 
1590 event sequence will have its Tcl command executed. The default value 
1591 is \f(CWall\fR.
1592 .TP
1593 \fB\-borderwidth \fIpixels\fR
1594 Sets the width of the 3-D border around the outside edge of the legend (if
1595 such border is being drawn; the \fBrelief\fR option determines this).
1596 The default is \f(CW2\fR pixels.
1597 .TP
1598 \fB\-font \fIfontName\fR 
1599 \fIFontName\fR specifies a font to use when drawing the labels of each
1600 element into the legend.  The default is
1601 \f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
1602 .TP
1603 \fB\-foreground \fIcolor\fR 
1604 Sets the foreground color of the text drawn for the element's label.
1605 The default is \f(CWblack\fR.
1606 .TP
1607 \fB\-hide \fIboolean\fR
1608 Indicates whether the legend should be displayed. If \fIboolean\fR is
1609 true, the legend will not be draw.  The default is \f(CWno\fR.
1610 .TP
1611 \fB\-ipadx \fIpad\fR 
1612 Sets the amount of internal padding to be added to the width of each
1613 legend entry.  \fIPad\fR can be a list of one or two screen distances.  If
1614 \fIpad\fR has two elements, the left side of the legend entry is
1615 padded by the first distance and the right side by the second.  If
1616 \fIpad\fR is just one distance, both the left and right sides are padded
1617 evenly.  The default is \f(CW2\fR.
1618 .TP
1619 \fB\-ipady \fIpad\fR
1620 Sets an amount of internal padding to be added to the height of each
1621 legend entry.  \fIPad\fR can be a list of one or two screen distances.  If
1622 \fIpad\fR has two elements, the top of the entry is padded by the
1623 first distance and the bottom by the second.  If \fIpad\fR is just
1624 one distance, both the top and bottom of the entry are padded evenly.
1625 The default is \f(CW2\fR.
1626 .TP
1627 \fB\-padx \fIpad\fR
1628 Sets the padding to the left and right exteriors of the legend.
1629 \fIPad\fR can be a list of one or two screen distances.  If \fIpad\fR
1630 has two elements, the left side of the legend is padded by the first
1631 distance and the right side by the second.  If \fIpad\fR has just one
1632 distance, both the left and right sides are padded evenly.  The
1633 default is \f(CW4\fR.
1634 .TP
1635 \fB\-pady \fIpad\fR
1636 Sets the padding above and below the legend.  \fIPad\fR can be a list
1637 of one or two screen distances.  If \fIpad\fR has two elements, the area above
1638 the legend is padded by the first distance and the area below by the
1639 second.  If \fIpad\fR is just one distance, both the top and
1640 bottom areas are padded evenly.  The default is \f(CW0\fR.
1641 .TP
1642 \fB\-position \fIpos\fR
1643 Specifies where the legend is drawn. The
1644 \fB\-anchor\fR option also affects where the legend is positioned.  If
1645 \fIpos\fR is \f(CWleft\fR, \f(CWleft\fR, \f(CWtop\fR, or \f(CWbottom\fR, the
1646 legend is drawn in the specified margin.  If \fIpos\fR is
1647 \f(CWplotarea\fR, then the legend is drawn inside the plotting area at a
1648 particular anchor.  If \fIpos\fR is in the form "\fI@x,y\fR", where
1649 \fIx\fR and \fIy\fR are the window coordinates, the legend is drawn in
1650 the plotting area at the specified coordinates.  The default is
1651 \f(CWright\fR.
1652 .TP
1653 \fB\-raised \fIboolean\fR
1654 Indicates whether the legend is above or below the data elements.  This
1655 matters only if the legend is in the plotting area.  If \fIboolean\fR
1656 is true, the legend will be drawn on top of any elements that may
1657 overlap it. The default is \f(CWno\fR.
1658 .TP
1659 \fB\-relief \fIrelief\fR
1660 Specifies the 3-D effect for the border around the legend.
1661 \fIRelief\fR specifies how the interior of the legend should appear
1662 relative to the bar chart; for example, \f(CWraised\fR means the legend
1663 should appear to protrude from the bar chart, relative to the surface of
1664 the bar chart.  The default is \f(CWsunken\fR.
1665 .PP
1666 Legend configuration options may also be set by the \fBoption\fR
1667 command.  The resource name and class are \f(CWlegend\fR and
1668 \f(CWLegend\fR respectively.
1669 .CS
1670 option add *Barchart.legend.Foreground blue
1671 option add *Barchart.Legend.Relief     raised
1672 .CE
1673 .RE
1674 .TP
1675 \fIpathName \fBlegend deactivate \fIpattern\fR...
1676 Selects legend entries to be drawn using the normal legend colors and
1677 relief.  All entries whose element names match \fIpattern\fR are
1678 selected.  To be selected, the element name must match only one
1679 \fIpattern\fR.
1680 .TP
1681 \fIpathName \fBlegend get \fIpos\fR
1682 Returns the name of the element whose entry is at the screen position
1683 \fIpos\fR in the legend.  \fIPos\fR must be in the form "\fI@x,y\fR",
1684 where \fIx\fR and \fIy\fR are window coordinates.  If the given
1685 coordinates do not lie over a legend entry, \f(CW""\fR is returned.
1686 .SS "PEN COMPONENTS"
1687 Pens define attributes for elements.
1688 Pens mirror the configuration options of data elements that pertain to
1689 how symbols and lines are drawn.  Data elements use pens to determine
1690 how they are drawn.  A data element may use several pens at once.  In
1691 this case, the pen used for a particular data point is determined from
1692 each element's weight vector (see the element's \fB\-weight\fR and
1693 \fB\-style\fR options).
1694 .PP
1695 One pen, called \f(CWactiveBar\fR, is automatically created.
1696 It's used as the default active pen for elements. So you can change
1697 the active attributes for all elements by simply reconfiguring this
1698 pen.
1699 .CS
1700 \&.g pen configure "activeBar" -fg green -bg green4
1701 .CE
1702 You can create and use several pens. To create a pen, invoke
1703 the pen component and its create operation.
1704 .CS
1705 \&.g pen create myPen
1706 .CE
1707 You map pens to a data element using either the element's 
1708 \fB\-pen\fR or \fB\-activepen\fR options.
1709 .CS
1710 \&.g element create "e1" -xdata $x -ydata $tempData \\
1711     -pen myPen
1712 .CE
1713 An element can use several pens at once. This is done by specifying
1714 the name of the pen in the element's style list (see the
1715 \fB\-styles\fR option).
1716 .CS
1717 \&.g element configure "e1" -styles { myPen 2.0 3.0 }
1718 .CE
1719 This says that any data point with a weight between 2.0 and 3.0
1720 is to be drawn using the pen \f(CWmyPen\fR.  All other points
1721 are drawn with the element's default attributes.
1722 .PP
1723 The following operations are available for pen components.
1724 .PP
1725 .TP
1726 \fIpathName \fBpen \fBcget \fIpenName \fIoption\fR
1727 Returns the current value of the option given by \fIoption\fR for
1728 \fIpenName\fR.  \fIOption\fR may be any option described below
1729 for the pen \fBconfigure\fR operation.
1730 .TP
1731 \fIpathName \fBpen \fBconfigure \fIpenName \fR?\fIpenName\fR... ?\fIoption value\fR?...
1732 Queries or modifies the configuration options of
1733 \fIpenName\fR. Several pens can be modified at once.  If \fIoption\fR
1734 isn't specified, a list describing the current options for
1735 \fIpenName\fR is returned.  If \fIoption\fR is specified, but not
1736 \fIvalue\fR, then a list describing \fIoption\fR is returned.  If one
1737 or more \fIoption\fR and \fIvalue\fR pairs are specified, then for
1738 each pair, the pen option \fIoption\fR is set to \fIvalue\fR.  The
1739 following options are valid for pens.
1740 .RS
1741 .TP
1742 \fB\-background \fIcolor\fR
1743 Sets the the color of the border around each bar.  The default is
1744 \f(CWwhite\fR.
1745 .TP
1746 \fB\-borderwidth \fIpixels\fR
1747 Sets the border width of the 3-D border drawn around the outside of
1748 each bar.  The \fB\-relief\fR option determines if such a border is
1749 drawn.  \fIPixels\fR must be a valid screen distance like \f(CW2\fR or
1750 \f(CW0.25i\fR. The default is \f(CW2\fR.
1751 .TP
1752 \fB\-foreground \fIcolor\fR 
1753 Sets the color of the interior of the bars.  
1754 .TP
1755 \fB\-relief \fIstring\fR
1756 Specifies the 3-D effect desired for bars.  \fIRelief\fR indicates how
1757 the interior of the bar should appear relative to the surface of the
1758 chart; for example, \f(CWraised\fR means the bar should appear to
1759 protrude from the bar chart, relative to the surface of the plotting
1760 area.  The default is \f(CWraised\fR.
1761 .TP
1762 \fB\-stipple \fIbitmap\fR
1763 Specifies a stipple pattern with which to draw the bars.  If
1764 \fIbitmap\fR is \f(CW""\fR, then the bar is drawn in a solid fashion.
1765 .TP
1766 \fB\-type \fIelemType\fR 
1767 Specifies the type of element the pen is to be used with.
1768 This option should only be employed when creating the pen.  This
1769 is for those that wish to mix different types of elements (bars and
1770 lines) on the same graph.  The default type is "bar".
1771 .PP
1772 Pen configuration options may be also be set by the \fBoption\fR
1773 command.  The resource class is \f(CWPen\fR.  The resource names
1774 are the names of the pens.
1775 .CS
1776 option add *Barchart.Pen.Foreground        blue
1777 option add *Barchart.activeBar.foreground  green
1778 .CE
1779 .RE
1780 .TP
1781 \fIpathName \fBpen \fBcreate \fIpenName \fR?\fIoption value\fR?...
1782 Creates a new pen by the name \fIpenName\fR.  No pen by the same
1783 name can already exist. \fIOption\fR and \fIvalue\fR are described 
1784 in above in the pen \fBconfigure\fR operation.
1785 .TP
1786 \fIpathName \fBpen \fBdelete \fR?\fIpenName\fR?...
1787 Deletes the named pens. A pen is not really
1788 deleted until it is not longer in use, so it's safe to delete
1789 pens mapped to elements.
1790 .TP
1791 \fIpathName \fBpen names \fR?\fIpattern\fR?...
1792 Returns a list of pens matching zero or more patterns.  If no
1793 \fIpattern\fR argument is give, the names of all pens are returned.
1794 .SS "POSTSCRIPT COMPONENT"
1795 The barchart can generate encapsulated PostScript output.  There
1796 are several configuration options you can specify to control how the
1797 plot will be generated.  You can change the page dimensions and
1798 borders.  The plot itself can be scaled, centered, or rotated to
1799 landscape.  The PostScript output can be written directly to a file or
1800 returned through the interpreter.
1801 .PP
1802 The following postscript operations are available.
1803 .TP
1804 \fIpathName \fBpostscript cget \fIoption\fR 
1805 Returns the current value of the postscript option given by
1806 \fIoption\fR.  \fIOption\fR may be any option described
1807 below for the postscript \fBconfigure\fR operation.
1808 .TP
1809 \fIpathName \fBpostscript configure \fR?\fIoption value\fR?...
1810 Queries or modifies the configuration options for PostScript
1811 generation.  If \fIoption\fR isn't specified, a list describing 
1812 the current postscript options for \fIpathName\fR is returned.  If
1813 \fIoption\fR is specified, but not \fIvalue\fR, then a list describing
1814 \fIoption\fR is returned.  If one or more \fIoption\fR and \fIvalue\fR
1815 pairs are specified, then for each pair, the postscript option
1816 \fIoption\fR is set to \fIvalue\fR.  The following postscript options
1817 are available.
1818 .RS
1819 .TP
1820 \fB\-center \fIboolean\fR
1821 Indicates whether the plot should be centered on the PostScript page.  If
1822 \fIboolean\fR is false, the plot will be placed in the upper left
1823 corner of the page.  The default is \f(CW1\fR.
1824 .TP
1825 \fB\-colormap \fIvarName\fR
1826 \fIVarName\fR must be the name of a global array variable that
1827 specifies a color mapping from the X color name to PostScript.  Each
1828 element of \fIvarName\fR must consist of PostScript code to set a
1829 particular color value (e.g. ``\f(CW1.0 1.0 0.0 setrgbcolor\fR'').  When
1830 generating color information in PostScript, the array variable \fIvarName\fR
1831 is checked if an element of the name as the color exists. If so, it uses 
1832 its value as the PostScript
1833 command to set the color.  If this option hasn't been specified, or if
1834 there isn't an entry in \fIvarName\fR for a given color, then it uses
1835 the red, green, and blue intensities from the X color.
1836 .TP
1837 \fB\-colormode \fImode\fR
1838 Specifies how to output color information.  \fIMode\fR must be either
1839 \f(CWcolor\fR (for full color output), \f(CWgray\fR (convert all colors to
1840 their gray-scale equivalents) or \f(CWmono\fR (convert foreground colors
1841 to black and background colors to white).  The default mode is
1842 \f(CWcolor\fR. 
1843 .TP
1844 \fB\-fontmap \fIvarName\fR
1845 \fIVarName\fR must be the name of a global array variable that
1846 specifies a font mapping from the X font name to PostScript.  Each
1847 element of \fIvarName\fR must consist of a Tcl list with one or two
1848 elements; the name and point size of a PostScript font.
1849 When outputting PostScript commands for a particular font, the array
1850 variable \fIvarName\fR is checked to see if an element by the 
1851 specified font exists.  If there is such an element, then the font
1852 information contained in that element is used in the PostScript
1853 output.  (If the point size is omitted from the list, the point size
1854 of the X font is used).  Otherwise the X font is examined in an
1855 attempt to guess what PostScript font to use.  This works only for
1856 fonts whose foundry property is \fIAdobe\fR (such as Times, Helvetica,
1857 Courier, etc.).  If all of this fails then the font defaults to
1858 \f(CWHelvetica-Bold\fR.
1859 .TP
1860 \fB\-decorations \fIboolean\fR
1861 Indicates whether PostScript commands to generate color backgrounds and 3-D
1862 borders will be output.  If \fIboolean\fR is false, the graph will
1863 background will be white and no 3-D borders will be generated. The
1864 default is \f(CW1\fR.
1865 .TP
1866 \fB\-height \fIpixels\fR
1867 Sets the height of the plot.  This lets you print the bar chart with a
1868 height different from the one drawn on the screen.  If
1869 \fIpixels\fR is 0, the height is the same as the widget's height.
1870 The default is \f(CW0\fR.
1871 .TP
1872 \fB\-landscape \fIboolean\fR
1873 If \fIboolean\fR is true, this specifies the printed area is to be
1874 rotated 90 degrees.  In non-rotated output the X\-axis of the printed
1875 area runs along the short dimension of the page (``portrait''
1876 orientation); in rotated output the X\-axis runs along the long
1877 dimension of the page (``landscape'' orientation).  Defaults to
1878 \f(CW0\fR.
1879 .TP
1880 \fB\-maxpect \fIboolean\fR
1881 Indicates to scale the plot so that it fills the PostScript page.
1882 The aspect ratio of the barchart is still retained.  The default is
1883 \f(CW0\fR.
1884 .TP
1885 \fB\-padx \fIpad\fR
1886 Sets the horizontal padding for the left and right page borders.  The
1887 borders are exterior to the plot.  \fIPad\fR can be a list of one or
1888 two screen distances.  If \fIpad\fR has two elements, the left border is padded
1889 by the first distance and the right border by the second.  If
1890 \fIpad\fR has just one distance, both the left and right borders are
1891 padded evenly.  The default is \f(CW1i\fR.
1892 .TP
1893 \fB\-pady \fIpad\fR 
1894 Sets the vertical padding for the top and bottom page borders. The
1895 borders are exterior to the plot.  \fIPad\fR can be a list of one or
1896 two screen distances.  If \fIpad\fR has two elements, the top border is padded
1897 by the first distance and the bottom border by the second.  If
1898 \fIpad\fR has just one distance, both the top and bottom borders are
1899 padded evenly.  The default is \f(CW1i\fR.
1900 .TP
1901 \fB\-paperheight \fIpixels\fR
1902 Sets the height of the postscript page.  This can be used to select
1903 between different page sizes (letter, A4, etc).  The default height is
1904 \f(CW11.0i\fR.
1905 .TP
1906 \fB\-paperwidth \fIpixels\fR
1907 Sets the width of the postscript page.  This can be used to select
1908 between different page sizes (letter, A4, etc).  The default width is
1909 \f(CW8.5i\fR.
1910 .TP
1911 \fB\-width \fIpixels\fR
1912 Sets the width of the plot.  This lets you generate a plot
1913 of a width different from that of the widget.  If \fIpixels\fR
1914 is 0, the width is the same as the widget's width.  The default is
1915 \f(CW0\fR.
1916 .PP
1917 Postscript configuration options may be also be set by the
1918 \fBoption\fR command.  The resource name and class are
1919 \f(CWpostscript\fR and \f(CWPostscript\fR respectively.
1920 .CS
1921 option add *Barchart.postscript.Decorations false
1922 option add *Barchart.Postscript.Landscape   true
1923 .CE
1924 .RE
1925 .TP
1926 \fIpathName \fBpostscript output \fR?\fIfileName\fR? ?\fIoption value\fR?...
1927 Outputs a file of encapsulated PostScript.  If a
1928 \fIfileName\fR argument isn't present, the command returns the
1929 PostScript. If any \fIoption-value\fR pairs are present, they set
1930 configuration options controlling how the PostScript is generated.
1931 \fIOption\fR and \fIvalue\fR can be anything accepted by the
1932 postscript \fBconfigure\fR operation above.
1933 .SS "MARKER COMPONENTS"
1934 Markers are simple drawing procedures used to annotate or highlight
1935 areas of the graph.  Markers have various types: text strings,
1936 bitmaps, images, connected lines, windows, or polygons.  They can be
1937 associated with a particular element, so that when the element is
1938 hidden or un-hidden, so is the marker.  By default, markers are the
1939 last items drawn, so that data elements will appear in
1940 behind them.  You can change this by configuring the \fB\-under\fR
1941 option.
1942 .PP
1943 Markers, in contrast to elements, don't affect the scaling of the
1944 coordinate axes.  They can also have \fIelastic\fR coordinates
1945 (specified by \f(CW-Inf\fR and \f(CWInf\fR respectively) that translate
1946 into the minimum or maximum limit of the axis.  For example, you can
1947 place a marker so it always remains in the lower left corner of the
1948 plotting area, by using the coordinates \f(CW-Inf\fR,\f(CW-Inf\fR.
1949 .PP
1950 The following operations are available for markers.
1951 .TP
1952 \fIpathName \fBmarker after \fImarkerId\fR ?\fIafterId\fR?
1953 Changes the order of the markers, drawing the first
1954 marker after the second.  If no second \fIafterId\fR argument is
1955 specified, the marker is placed at the end of the display list.  This
1956 command can be used to control how markers are displayed since markers
1957 are drawn in the order of this display list.
1958 .TP
1959 \fIpathName \fBmarker before \fImarkerId\fR ?\fIbeforeId\fR?
1960 Changes the order of the markers, drawing the first
1961 marker before the second.  If no second \fIbeforeId\fR argument is
1962 specified, the marker is placed at the beginning of the display list.
1963 This command can be used to control how markers are displayed since
1964 markers are drawn in the order of this display list.
1965 .TP
1966 \fIpathName \fBmarker bind \fItagName\fR ?\fIsequence\fR?  ?\fIcommand\fR? 
1967 Associates \fIcommand\fR with \fItagName\fR such that whenever the
1968 event sequence given by \fIsequence\fR occurs for a marker with this
1969 tag, \fIcommand\fR will be invoked.  The syntax is similar to the 
1970 \fBbind\fR command except that it operates on graph markers, rather 
1971 than widgets. See the \fBbind\fR manual entry for
1972 complete details on \fIsequence\fR and the substitutions performed on 
1973 \fIcommand\fR before invoking it.  
1974 .sp
1975 If all arguments are specified then a new binding is created, replacing 
1976 any existing binding for the same \fIsequence\fR and \fItagName\fR.
1977 If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR 
1978 augments an existing binding rather than replacing it. 
1979 If no \fIcommand\fR argument is provided then the command currently
1980 associated with \fItagName\fR and \fIsequence\fR (it's an error occurs 
1981 if there's no such binding) is returned.  If both \fIcommand\fR and 
1982 \fIsequence\fR are missing then a list of all the event sequences for 
1983 which bindings have been defined for \fItagName\fR. 
1984 .TP
1985 \fIpathName \fBmarker cget \fIoption\fR
1986 Returns the current value of the marker configuration option given by
1987 \fIoption\fR.  \fIOption\fR may be any option described
1988 below in the \fBconfigure\fR operation.
1989 .TP
1990 \fIpathName \fBmarker configure \fImarkerId\fR ?\fIoption value\fR?...
1991 Queries or modifies the configuration options for markers.  If
1992 \fIoption\fR isn't specified, a list describing the current
1993 options for \fImarkerId\fR is returned.  If \fIoption\fR is specified,
1994 but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
1995 If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
1996 for each pair, the marker option \fIoption\fR is set to \fIvalue\fR.
1997 .sp
1998 The following options are valid for all markers.
1999 Each type of marker also has its own type-specific options.  
2000 They are described in the sections below.
2001 .RS
2002 .TP
2003 \fB\-bindtags \fItagList\fR
2004 Specifies the binding tags for the marker.  \fITagList\fR is a list
2005 of binding tag names.  The tags and their order will determine how
2006 events for markers are handled.  Each tag in the list matching the 
2007 current event sequence will have its Tcl command executed.  Implicitly 
2008 the name of the marker is always the first tag in the list.
2009 The default value is \f(CWall\fR.
2010 .TP
2011 \fB\-coords \fIcoordList\fR
2012 Specifies the coordinates of the marker.  \fICoordList\fR is 
2013 a list of graph coordinates.  The number of coordinates required
2014 is dependent on the type of marker.  Text, image, and window markers
2015 need only two coordinates (an X\-Y coordinate).   Bitmap markers
2016 can take either two or four coordinates (if four, they represent the
2017 corners of the bitmap). Line markers
2018 need at least four coordinates, polygons at least six.
2019 If \fIcoordList\fR is \f(CW""\fR, the marker will not be displayed.
2020 The default is \f(CW""\fR.
2021 .TP
2022 \fB\-element \fIelemName\fR
2023 Links the marker with the element \fIelemName\fR.  The marker is
2024 drawn only if the element is also currently displayed (see the
2025 element's \fBshow\fR operation).  If \fIelemName\fR is \f(CW""\fR, the
2026 marker is always drawn.  The default is \f(CW""\fR.
2027 .TP
2028 \fB\-hide \fIboolean\fR 
2029 Indicates whether the marker is drawn. If \fIboolean\fR is true,
2030 the marker is not drawn.  The default is \f(CWno\fR.
2031 .TP
2032 \fB\-mapx \fIxAxis\fR 
2033 Specifies the X\-axis to map the marker's X\-coordinates onto.
2034 \fIXAxis\fR must the name of an axis.  The default is \f(CWx\fR.
2035 .TP
2036 \fB\-mapy \fIyAxis\fR
2037 Specifies the Y\-axis to map the marker's Y\-coordinates onto.
2038 \fIYAxis\fR must the name of an axis.  The default is \f(CWy\fR.
2039 .TP
2040 \fB\-name \fImarkerId\fR
2041 Changes the identifier for the marker.  The identifier \fImarkerId\fR 
2042 can not already be used by another marker.  If this option
2043 isn't specified, the marker's name is uniquely generated.
2044 .TP
2045 \fB\-under \fIboolean\fR
2046 Indicates whether the marker is drawn below/above data
2047 elements.  If \fIboolean\fR is true, the marker is be drawn
2048 underneath the data elements.  Otherwise, the marker is
2049 drawn on top of the element.  The default is \f(CW0\fR.
2050 .TP
2051 \fB\-xoffset \fIpixels\fR
2052 Specifies a screen distance to offset the marker horizontally. 
2053 \fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
2054 The default is \f(CW0\fR.
2055 .TP
2056 \fB\-yoffset \fIpixels\fR
2057 Specifies a screen distance to offset the markers vertically.
2058 \fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
2059 The default is \f(CW0\fR.
2060 .PP
2061 Marker configuration options may also be set by the \fBoption\fR command.
2062 The resource class is either \f(CWBitmapMarker\fR,  \f(CWImageMarker\fR, 
2063 \f(CWLineMarker\fR, \f(CWPolygonMarker\fR, \f(CWTextMarker\fR, or \f(CWWindowMarker\fR,
2064 depending on the type of marker.  The resource name is the name of the
2065 marker.
2066 .CS
2067 option add *Barchart.TextMarker.Foreground white
2068 option add *Barchart.BitmapMarker.Foreground white
2069 option add *Barchart.m1.Background     blue
2070 .CE
2071 .RE
2072 .TP
2073 \fIpathName \fBmarker create \fItype\fR ?\fIoption value\fR?...
2074 Creates a marker of the selected type. \fIType\fR may be either
2075 \f(CWtext\fR, \f(CWline\fR, \f(CWbitmap\fR, \f(CWimage\fR, \f(CWpolygon\fR, or
2076 \f(CWwindow\fR.  This command returns the marker identifier, 
2077 used as the \fImarkerId\fR argument in the other marker-related
2078 commands.  If the \fB\-name\fR option is used, this overrides the
2079 normal marker identifier.  If the name provided is already used for
2080 another marker, the new marker will replace the old.
2081 .TP
2082 \fIpathName \fBmarker delete\fR ?\fIname\fR?...
2083 Removes one of more markers.  The graph will automatically be redrawn
2084 without the marker.\fR.  
2085 .TP
2086 \fIpathName \fBmarker exists \fImarkerId\fR 
2087 Returns \f(CW1\fR if the marker \fImarkerId\fR exists and \f(CW0\fR
2088 otherwise.
2089 .TP
2090 \fIpathName \fBmarker names\fR ?\fIpattern\fR?  
2091 Returns the names of all the markers that currently exist.  If
2092 \fIpattern\fR is supplied, only those markers whose names match it
2093 will be returned.
2094 .TP
2095 \fIpathName \fBmarker type \fImarkerId\fR 
2096 Returns the type of the marker given by \fImarkerId\fR, such as
2097 \f(CWline\fR or \f(CWtext\fR.  If \fImarkerId\fR is not a valid a marker
2098 identifier, \f(CW""\fR is returned.
2099 .SS "BITMAP MARKERS"
2100 A bitmap marker displays a bitmap.  The size of the
2101 bitmap is controlled by the number of coordinates specified.  If two
2102 coordinates, they specify the position of the top-left corner of the
2103 bitmap.  The bitmap retains its normal width and height.  If four
2104 coordinates, the first and second pairs of coordinates represent the
2105 corners of the bitmap.  The bitmap will be stretched or reduced as
2106 necessary to fit into the bounding rectangle.
2107 .PP
2108 Bitmap markers are created with the marker's \fBcreate\fR operation in
2109 the form:
2110 .DS
2111 \fIpathName \fBmarker create bitmap \fR?\fIoption value\fR?...
2112 .DE
2113 There may be many \fIoption\fR-\fIvalue\fR pairs, each 
2114 sets a configuration options for the marker.  These
2115 same \fIoption\fR\-\fIvalue\fR pairs may be used with the marker's
2116 \fBconfigure\fR operation.
2117 .PP
2118 The following options are specific to bitmap markers:
2119 .TP
2120 \fB\-background \fIcolor\fR
2121 Same as the \fB\-fill\fR option.
2122 .TP
2123 \fB\-bitmap \fIbitmap\fR
2124 Specifies the bitmap to be displayed.  If \fIbitmap\fR is \f(CW""\fR,
2125 the marker will not be displayed.  The default is \f(CW""\fR.
2126 .TP
2127 \fB\-fill \fIcolor\fR
2128 Sets the background color of the bitmap.  If \fIcolor\fR is the empty
2129 string, no background will be transparent.  The default background color is
2130 \f(CW""\fR.
2131 .TP
2132 \fB\-foreground \fIcolor\fR 
2133 Same as the \fB\-outline\fR option.
2134 .TP
2135 \fB\-mask \fImask\fR
2136 Specifies a mask for the bitmap to be displayed. This mask is a bitmap
2137 itself, denoting the pixels that are transparent.  If \fImask\fR is
2138 \f(CW""\fR, all pixels of the bitmap will be drawn.  The default is
2139 \f(CW""\fR.
2140 .TP
2141 \fB\-outline \fIcolor\fR
2142 Sets the foreground color of the bitmap. The default value is \f(CWblack\fR.
2143 .TP
2144 \fB\-rotate \fItheta\fR
2145 Sets the rotation of the bitmap.  \fITheta\fR is a real number
2146 representing the angle of rotation in degrees.  The marker is first
2147 rotated and then placed according to its anchor position.  The default
2148 rotation is \f(CW0.0\fR.
2149 .SS "IMAGE MARKERS"
2150 A image marker displays an image.  Image markers are
2151 created with the marker's \fBcreate\fR operation in the form:
2152 .DS
2153 \fIpathName \fBmarker create image \fR?\fIoption value\fR?...
2154 .DE
2155 There may be many \fIoption\fR-\fIvalue\fR
2156 pairs, each sets a configuration option
2157 for the marker.  These same \fIoption\fR\-\fIvalue\fR pairs may be
2158 used with the marker's \fBconfigure\fR operation.
2159 .PP
2160 The following options are specific to image markers:
2161 .TP
2162 \fB\-anchor \fIanchor\fR
2163 \fIAnchor\fR tells how to position the image relative to the
2164 positioning point for the image. For example, if \fIanchor\fR
2165 is \f(CWcenter\fR then the image is centered on the point;  if
2166 \fIanchor\fR is \f(CWn\fR then the image will be drawn such that
2167 the top center point of the rectangular region occupied by the
2168 image will be at the positioning point.
2169 This option defaults to \f(CWcenter\fR.
2170 .TP
2171 \fB\-image \fIimage\fR
2172 Specifies the image to be drawn.
2173 If \fIimage\fR is \f(CW""\fR, the marker will not be
2174 drawn.  The default is \f(CW""\fR.
2175 .SS "LINE MARKERS"
2176 A line marker displays one or more connected line segments.
2177 Line markers are created with marker's \fBcreate\fR operation in the form:
2178 .DS
2179 \fIpathName \fBmarker create line \fR?\fIoption value\fR?...
2180 .DE
2181 There may be many \fIoption\fR-\fIvalue\fR
2182 pairs, each sets a configuration option
2183 for the marker.  These same \fIoption\fR-\fIvalue\fR pairs may be
2184 used with the marker's \fBconfigure\fR operation.
2185 .PP
2186 The following options are specific to line markers:
2187 .TP
2188 \fB\-dashes \fIdashList\fR
2189 Sets the dash style of the line. \fIDashList\fR is a list of up to 11
2190 numbers that alternately represent the lengths of the dashes and gaps
2191 on the line.  Each number must be between 1 and 255.  If
2192 \fIdashList\fR is \f(CW""\fR, the marker line will be solid.
2193 .TP
2194 \fB\-fill \fIcolor\fR
2195 Sets the background color of the line.  This color is used with
2196 striped lines (see the \fB\-fdashes\R option). If \fIcolor\fR is
2197 the empty string, no background color is drawn (the line will be
2198 dashed, not striped).  The default background color is \f(CW""\fR.
2199 .TP
2200 \fB\-linewidth \fIpixels\fR
2201 Sets the width of the lines.
2202 The default width is \f(CW0\fR.
2203 .TP
2204 \fB\-outline \fIcolor\fR
2205 Sets the foreground color of the line. The default value is \f(CWblack\fR.
2206 .TP
2207 \fB\-stipple \fIbitmap\fR
2208 Specifies a stipple pattern used to draw the line, rather than
2209 a solid line.
2210 \fIBitmap\fR specifies a bitmap to use as the stipple
2211 pattern.  If \fIbitmap\fR is \f(CW""\fR, then the
2212 line is drawn in a solid fashion. The default is \f(CW""\fR.
2213 .SS "POLYGON MARKERS"
2214 A polygon marker displays a closed region described as two or more
2215 connected line segments.  It is assumed the first and
2216 last points are connected.  Polygon markers are created using the
2217 marker \fBcreate\fR operation in the form:
2218 .DS
2219 \fIpathName \fBmarker create polygon \fR?\fIoption value\fR?...
2220 .DE
2221 There may be many \fIoption\fR-\fIvalue\fR
2222 pairs, each sets a configuration option
2223 for the marker.  These same \fIoption\fR\-\fIvalue\fR pairs may be
2224 used with the \fBmarker configure\fR command to change the marker's
2225 configuration.
2226 The following options are supported for polygon markers:
2227 .TP
2228 \fB\-dashes \fIdashList\fR
2229 Sets the dash style of the outline of the polygon. \fIDashList\fR is a
2230 list of up to 11 numbers that alternately represent the lengths of
2231 the dashes and gaps on the outline.  Each number must be between 1 and
2232 255. If \fIdashList\fR is \f(CW""\fR, the outline will be a solid line.
2233 .TP
2234 \fB\-fill \fIcolor\fR
2235 Sets the fill color of the polygon.  If \fIcolor\fR is \f(CW""\fR, then
2236 the interior of the polygon is transparent.
2237 The default is \f(CWwhite\fR.
2238 .TP
2239 \fB\-linewidth \fIpixels\fR
2240 Sets the width of the outline of the polygon. If \fIpixels\fR is zero, 
2241 no outline is drawn. The default is \f(CW0\fR.
2242 .TP
2243 \fB\-outline \fIcolor\fR
2244 Sets the color of the outline of the polygon.  If the polygon is
2245 stippled (see the \fB\-stipple\fR option), then this represents the
2246 foreground color of the stipple.  The default is \f(CWblack\fR.
2247 .TP
2248 \fB\-stipple \fIbitmap\fR
2249 Specifies that the polygon should be drawn with a stippled pattern
2250 rather than a solid color. \fIBitmap\fR specifies a bitmap to use as
2251 the stipple pattern.  If \fIbitmap\fR is \f(CW""\fR, then the polygon is
2252 filled with a solid color (if the \fB\-fill\fR option is set).  The
2253 default is \f(CW""\fR.
2254 .SS "TEXT MARKERS"
2255 A text marker displays a string of characters on one or more lines of
2256 text.  Embedded newlines cause line breaks.  They may be used to
2257 annotate regions of the graph.  Text markers are created with the
2258 \fBcreate\fR operation in the form:
2259 .DS
2260 \fIpathName \fBmarker create text \fR?\fIoption value\fR?...
2261 .DE
2262 There may be many \fIoption\fR-\fIvalue\fR pairs, 
2263 each sets a configuration option for the text marker.  
2264 These same \fIoption\fR\-\fIvalue\fR pairs may be used with the 
2265 marker's \fBconfigure\fR operation.  
2266 .PP
2267 The following options are specific to text markers:
2268 .TP
2269 \fB\-anchor \fIanchor\fR
2270 \fIAnchor\fR tells how to position the text relative to the
2271 positioning point for the text. For example, if \fIanchor\fR is
2272 \f(CWcenter\fR then the text is centered on the point; if
2273 \fIanchor\fR is \f(CWn\fR then the text will be drawn such that the
2274 top center point of the rectangular region occupied by the text will
2275 be at the positioning point.  This default is \f(CWcenter\fR.
2276 .TP
2277 \fB\-background \fIcolor\fR
2278 Same as the \fB\-fill\fR option.
2279 .TP
2280 \fB\-font \fIfontName\fR
2281 Specifies the font of the text.  The default is
2282 \f(CW*-Helvetica-Bold-R-Normal-*-120-*\fR.
2283 .TP
2284 \fB\-fill \fIcolor\fR
2285 Sets the background color of the text.  If \fIcolor\fR is the empty
2286 string, no background will be transparent.  The default background color is
2287 \f(CW""\fR.
2288 .TP
2289 \fB\-foreground \fIcolor\fR
2290 Same as the \fB\-outline\fR option.
2291 .TP
2292 \fB\-justify \fIjustify\fR
2293 Specifies how the text should be justified.  This matters only when
2294 the marker contains more than one line of text. \fIJustify\fR must be
2295 \f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR.  The default is
2296 \f(CWcenter\fR.
2297 .TP
2298 \fB\-outline \fIcolor\fR
2299 Sets the color of the text. The default value is \f(CWblack\fR.
2300 .TP
2301 \fB\-padx \fIpad\fR
2302 Sets the padding to the left and right exteriors of the text.
2303 \fIPad\fR can be a list of one or two screen distances.  If \fIpad\fR
2304 has two elements, the left side of the text is padded by the first
2305 distance and the right side by the second.  If \fIpad\fR has just one
2306 distance, both the left and right sides are padded evenly.  The
2307 default is \f(CW4\fR.
2308 .TP
2309 \fB\-pady \fIpad\fR
2310 Sets the padding above and below the text.  \fIPad\fR can be a list of
2311 one or two screen distances.  If \fIpad\fR has two elements, the area above the
2312 text is padded by the first distance and the area below by the second.
2313 If \fIpad\fR is just one distance, both the top and bottom areas
2314 are padded evenly.  The default is \f(CW4\fR.
2315 .TP
2316 \fB\-rotate \fItheta\fR
2317 Specifies the number of degrees to rotate the text.  \fITheta\fR is a
2318 real number representing the angle of rotation.  The marker is first
2319 rotated along its center and is then drawn according to its anchor
2320 position. The default is \f(CW0.0\fR.
2321 .TP
2322 \fB\-text \fItext\fR
2323 Specifies the text of the marker.  The exact way the text is
2324 displayed may be affected by other options such as \fB\-anchor\fR or
2325 \fB\-rotate\fR.
2326 .SS "WINDOW MARKERS"
2327 A window marker displays a widget at a given position.
2328 Window markers are created with the marker's \fBcreate\fR operation in
2329 the form:
2330 .DS
2331 \fIpathName \fBmarker create window \fR?\fIoption value\fR?...
2332 .DE
2333 There may be many \fIoption\fR-\fIvalue\fR
2334 pairs, each sets a configuration option
2335 for the marker.  These same \fIoption\fR\-\fIvalue\fR pairs may be
2336 used with the marker's \fBconfigure\fR command.
2337 .PP
2338 The following options are specific to window markers:
2339 .TP
2340 \fB\-anchor \fIanchor\fR
2341 \fIAnchor\fR tells how to position the widget relative to the
2342 positioning point for the widget. For example, if \fIanchor\fR is
2343 \f(CWcenter\fR then the widget is centered on the point; if \fIanchor\fR
2344 is \f(CWn\fR then the widget will be displayed such that the top center
2345 point of the rectangular region occupied by the widget will be at the
2346 positioning point.  This option defaults to \f(CWcenter\fR.
2347 .TP
2348 \fB\-height \fIpixels\fR
2349 Specifies the height to assign to the marker's window.  If this option
2350 isn't specified, or if it is specified as \f(CW""\fR, then the window is
2351 given whatever height the widget requests internally.
2352 .TP
2353 \fB\-width \fIpixels\fR
2354 Specifies the width to assign to the marker's window.  If this option
2355 isn't specified, or if it is specified as \f(CW""\fR, then the window is
2356 given whatever width the widget requests internally.
2357 .TP
2358 \fB\-window \fIpathName\fR
2359 Specifies the widget to be managed by the barchart.  \fIPathName\fR must
2360 be a child of the \fBbarchart\fR widget.
2361 .SH "GRAPH COMPONENT BINDINGS"
2362 Specific barchart components, such as elements, markers and legend
2363 entries, can have a command trigger when event occurs in them, much
2364 like canvas items in Tk's canvas widget.  Not all event sequences are
2365 valid.  The only binding events that may be specified are those
2366 related to the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
2367 \fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR).
2368 .PP
2369 Only one element or marker can be picked during an event.  This means,
2370 that if the mouse is directly over both an element and a marker, only
2371 the uppermost component is selected.  This isn't true for legend entries.  
2372 Both a legend entry and an element (or marker) binding commands 
2373 will be invoked if both items are picked.
2374 .PP
2375 It is possible for multiple bindings to match a particular event.
2376 This could occur, for example, if one binding is associated with the
2377 element name and another is associated with one of the element's tags
2378 (see the \fB\-bindtags\fR option).  When this occurs, all of the 
2379 matching bindings are invoked.  A binding associated with the element
2380 name is invoked first, followed by one binding for each of the element's 
2381 bindtags.  If there are multiple matching bindings for a single tag, 
2382 then only the most specific binding is invoked.  A continue command 
2383 in a binding script terminates that script, and a break command 
2384 terminates that script and skips any remaining scripts for the event, 
2385 just as for the bind command.
2386 .PP
2387 The \fB\-bindtags\fR option for these components controls addition
2388 tag names which can be matched.  Implicitly elements and markers
2389 always have tags matching their names.  Setting the value of
2390 the \fB\-bindtags\fR option doesn't change this.
2391 .SH "C LANGUAGE API"
2392 You can manipulate data elements from the C language.  There
2393 may be situations where it is too expensive to translate the data
2394 values from ASCII strings.  Or you might want to read data in a
2395 special file format.
2396 .PP
2397 Data can manipulated from the C language using BLT vectors.
2398 You specify the X-Y data coordinates of an element as vectors and
2399 manipulate the vector from C.  The barchart will be redrawn automatically
2400 after the vectors are updated.
2401 .PP
2402 From Tcl, create the vectors and configure the element to use them.
2403 .CS
2404 vector X Y
2405 \&.g element configure line1 -xdata X -ydata Y
2406 .CE
2407 To set data points from C, you pass the values as arrays of doubles
2408 using the \fBBlt_ResetVector\fR call.  The vector is reset with the
2409 new data and at the next idle point (when Tk re-enters its event
2410 loop), the graph will be redrawn automatically.
2411 .CS
2412 #include <tcl.h>
2413 #include <blt.h>
2414
2415 register int i;
2416 Blt_Vector *xVec, *yVec;
2417 double x[50], y[50];
2418
2419 /* Get the BLT vectors "X" and "Y" (created above from Tcl) */
2420 if ((Blt_GetVector(interp, "X", 50, &xVec) != TCL_OK) ||
2421     (Blt_GetVector(interp, "Y", 50, &yVec) != TCL_OK)) {
2422     return TCL_ERROR;
2423 }
2424
2425 for (i = 0; i < 50; i++) {
2426     x[i] = i * 0.02;
2427     y[i] = sin(x[i]);
2428 }       
2429
2430 /* Put the data into BLT vectors */
2431 if ((Blt_ResetVector(xVec, x, 50, 50, TCL_VOLATILE) != TCL_OK) ||
2432     (Blt_ResetVector(yVec, y, 50, 50, TCL_VOLATILE) != TCL_OK)) {
2433    return TCL_ERROR;
2434 }
2435 .CE
2436 See the \fBvector\fR manual page for more details.
2437 .SH SPEED TIPS
2438 There may be cases where the bar chart needs to be drawn and updated as
2439 quickly as possible.  If drawing speed becomes a big
2440 problem, here are a few tips to speed up displays.
2441 .TP 2
2442 \(bu 
2443 Try to minimize the number of data points.  The more data points 
2444 looked at, the more work the bar chart must do.  
2445 .TP 2
2446 \(bu 
2447 If your data is generated as floating point values, the time required
2448 to convert the data values to and from ASCII strings can be
2449 significant, especially when there any many data points.  You can
2450 avoid the redundant string-to-decimal conversions using the C API to
2451 BLT vectors.
2452 .TP 2
2453 \(bu
2454 Don't stipple or dash the element.  Solid bars are much faster.
2455 .TP 2
2456 \(bu 
2457 If you update data elements frequently, try turning off the
2458 widget's \fB\-bufferelements\fR option.  When the bar chart is first
2459 displayed, it draws data elements into an internal pixmap.  The pixmap
2460 acts as a cache, so that when the bar chart needs to be redrawn again, and
2461 the data elements or coordinate axes haven't changed, the pixmap is
2462 simply copied to the screen.  This is especially useful when you are
2463 using markers to highlight points and regions on the bar chart.  But if
2464 the bar chart is updated frequently, changing either the element data or
2465 coordinate axes, the buffering becomes redundant.
2466 .SH LIMITATIONS
2467 Auto-scale routines do not use requested min/max limits
2468 as boundaries when the axis is logarithmically scaled.  
2469 .PP
2470 The PostScript output generated for polygons with more than 1500
2471 points may exceed the limits of some printers (See PostScript Language
2472 Reference Manual, page 568).  The work-around is to break the polygon
2473 into separate pieces.
2474 .SH KEYWORDS
2475 bar chart, widget