diff options
-rw-r--r-- | tests/base.tcl | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/tests/base.tcl b/tests/base.tcl index 6c50063..d69e609 100644 --- a/tests/base.tcl +++ b/tests/base.tcl @@ -63,6 +63,19 @@ proc bltCmd {graph args} { after $sleep } +proc bltElements {graph} { + $graph element create data1 \ + -xdata { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } \ + -ydata { 13 25 36 46 55 64 70 75 80 90}\ + -color blue + $graph element create data2 \ + -xdata { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } \ + -ydata { 26 50 72 92 110 128 140 150 160 180}\ + -yerror {10 10 10 10 10 10 10 10 10 10 10} \ + -color red + $graph legend configure -title "Legend" +} + proc bltBarGraph {w} { global sleep @@ -76,20 +89,10 @@ proc bltBarGraph {w} { -barmode aligned \ ] pack $graph -expand yes -fill both - - $graph element create data1 \ - -xdata { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } \ - -ydata { 13 25 36 46 55 64 70 75 80 90}\ - -color blue - $graph element create data2 \ - -xdata { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } \ - -ydata { 26 50 72 92 110 128 140 150 160 180}\ - -color red - $graph legend configure -title "Legend" + bltElements $graph update after $sleep - return $graph } @@ -104,20 +107,9 @@ proc bltLineGraph {w} { -title $title \ ] pack $graph -expand yes -fill both - - $graph element create data1 \ - -xdata {0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0} \ - -ydata {13 25 36 46 55 64 70 75 80 90} \ - -color blue - $graph element create data2 \ - -xdata {0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0} \ - -ydata {26 50 72 92 110 128 140 150 160 180} \ - -yerror {10 10 10 10 10 10 10 10 10 10 10} \ - -color red - $graph legend configure -title "Legend" + bltElements $graph update after $sleep - return $graph } |