1#! /bin/sh
2# -*- tcl -*- \
3exec tclsh "$0" ${1+"$@"}
4
5package require Tcl 8.4
6package require Tk
7
8package require Plotchart
9
10# plotdemos4.tcl --
11#     Show a 3D bar chart
12#
13
14canvas .c  -width 400 -height 400 -bg white
15toplevel .t
16canvas .t.c2 -width 300 -height 200 -bg white
17canvas .t.c3 -width 300 -height 200 -bg white
18canvas .t.c4 -width 300 -height 200 -bg white
19pack   .c -fill both
20pack   .t.c2 .t.c3 .t.c4 -fill both
21
22#
23# 3D barchart
24#
25set s [::Plotchart::create3DBarchart .c {-200.0 900.0 100.0} 7]
26
27foreach {bar value} {red 765 green 234 blue 345 yellow 321
28                     magenta 567 cyan -123 white 400} {
29
30    $s plot $bar $value $bar
31}
32
33$s title "3D Bars"
34
35$s balloon 1.2 100 "Arrow pointing\nat second bar" south-east
36
37#
38# Three styles of radial charts
39#
40foreach {style canvas} {lines .t.c2 cumulative .t.c3 filled .t.c4} {
41    set s [::Plotchart::createRadialchart $canvas {A B LongerName C D} 10.0 $style]
42
43    $s plot {1 2 3 4 3} green 2
44    $s plot {4 5 0 1 4} red   3
45
46    $s title "Sample of a radial chart - style: $style"
47}
48