From b8968fb771ec905f3dd6d9de54fe96478b9c46b3 Mon Sep 17 00:00:00 2001 From: joye Date: Tue, 20 May 2014 18:24:00 +0000 Subject: *** empty log message *** --- src/bltGraphBar.C | 6 ++---- tests/barelement.tcl | 11 ++++++----- tests/bargraph.tcl | 2 +- tests/lineelement.tcl | 2 +- tests/linegraph.tcl | 2 +- tests/linepen.tcl | 39 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 tests/linepen.tcl diff --git a/src/bltGraphBar.C b/src/bltGraphBar.C index 281a5de..a3a93e1 100644 --- a/src/bltGraphBar.C +++ b/src/bltGraphBar.C @@ -354,8 +354,7 @@ void BarGraph::initBarSets() else tablePtr = (Tcl_HashTable*)Tcl_GetHashValue(hhPtr); - const char* name = (ops->groupName) ? - ops->groupName : ops->yAxis->name_; + const char* name = ops->groupName ? ops->groupName : ops->yAxis->name_; Tcl_HashEntry* hhPtr2 = Tcl_CreateHashEntry(tablePtr, name, &isNew); size_t count =1; if (!isNew) { @@ -484,8 +483,7 @@ void BarGraph::computeBarStacks() continue; Tcl_HashTable *tablePtr = (Tcl_HashTable*)Tcl_GetHashValue(hPtr); - const char *name = (ops->groupName) ? - ops->groupName : ops->yAxis->name_; + const char *name = ops->groupName ? ops->groupName : ops->yAxis->name_; hPtr = Tcl_FindHashEntry(tablePtr, name); if (!hPtr) continue; diff --git a/tests/barelement.tcl b/tests/barelement.tcl index 19a0a00..a0b971c 100644 --- a/tests/barelement.tcl +++ b/tests/barelement.tcl @@ -3,16 +3,17 @@ source base.tcl set w .bar set graph [bltBarGraph $w] -$graph element configure data1 -showvalues y +$graph element configure data1 -color red -showvalues y +$graph element configure data2 -color blue $graph pen create foo -showvalues y -color purple $graph element activate data3 -echo "Bar Element" +echo "Testing Bar Element..." bltTest3 $graph element data3 -activepen foo bltTest3 $graph element data2 -background yellow -bltTest3 $graph element data2 -barwidth 10 +bltTest3 $graph element data2 -barwidth 1 bltTest3 $graph element data2 -bd 4 bltTest3 $graph element data2 -bg yellow #bltTest3 $graph element data2 -bindtags @@ -59,9 +60,9 @@ bltTest3 $graph element data2 -yerror {5 5 5 5 5 5 5 5 5 5 5} bltCmd $graph element activate data2 bltCmd $graph element deactivate data2 #bltCmd $graph element bind data1 [list puts "%x %y"] -bltCmd $graph element cget data1 -smooth +bltCmd $graph element cget data1 -showvalues bltCmd $graph element configure data1 -bltCmd $graph element configure data1 -smooth +bltCmd $graph element configure data1 -showvalues #bltCmd $graph element closest 50 50 #bltCmd $graph element closest 50 50 data1 data2 bltCmd $graph element create data4 diff --git a/tests/bargraph.tcl b/tests/bargraph.tcl index 34f320e..66e62c7 100644 --- a/tests/bargraph.tcl +++ b/tests/bargraph.tcl @@ -3,7 +3,7 @@ source base.tcl set w .bar set graph [bltBarGraph $w] -echo "Testing BarGraph..." +echo "Testing Bar Graph..." # Graph bltTest $graph -aspect 2 diff --git a/tests/lineelement.tcl b/tests/lineelement.tcl index addab07..d0ffcf5 100644 --- a/tests/lineelement.tcl +++ b/tests/lineelement.tcl @@ -8,7 +8,7 @@ $graph element configure data1 -dash {8 3} -showvalues y -smooth step -symbol ci $graph pen create foo -showvalues y -symbol circle -dashes {8 3} -color purple $graph element activate data3 -echo "Line Element" +echo "Testing Line Element.." bltTest3 $graph element data3 -activepen foo bltTest3 $graph element data2 -areabackground yellow diff --git a/tests/linegraph.tcl b/tests/linegraph.tcl index b934cf7..020816e 100644 --- a/tests/linegraph.tcl +++ b/tests/linegraph.tcl @@ -3,7 +3,7 @@ source base.tcl set w .line set graph [bltLineGraph $w] -echo "Testing LineGraph..." +echo "Testing Line Graph..." bltTest $graph -aspect 2 bltTest $graph -background red diff --git a/tests/linepen.tcl b/tests/linepen.tcl new file mode 100644 index 0000000..38b29fc --- /dev/null +++ b/tests/linepen.tcl @@ -0,0 +1,39 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +$graph pen create foo -showvalues y -symbol circle -dashes "8 4" +$graph element configure data2 -pen foo + +echo "Testing Line Pen..." + +bltTest3 $graph pen foo -color red +bltTest3 $graph pen foo -dashes "5 8 3" +bltTest3 $graph pen foo -errorbarcolor yellow +bltTest3 $graph pen foo -errorbarwidth 2 +bltTest3 $graph pen foo -fill green +bltTest3 $graph pen foo -linewidth 2 +bltTest3 $graph pen foo -offdash yellow +bltTest3 $graph pen foo -outline green +bltTest3 $graph pen foo -outlinewidth 2 +bltTest3 $graph pen foo -pixels 20 +bltTest3 $graph pen foo -showvalues none +bltTest3 $graph pen foo -symbol square +bltTest3 $graph pen foo -valueanchor n +bltTest3 $graph pen foo -valuecolor cyan +bltTest3 $graph pen foo -valuefont "times 18 bold italic" +bltTest3 $graph pen foo -valueformat "%e" +bltTest3 $graph pen foo -valuerotate 45 + +bltCmd $graph pen cget foo -color +bltCmd $graph pen configure foo +bltCmd $graph pen configure foo -color +bltCmd $graph pen create bar +bltCmd $graph pen delete bar +bltCmd $graph pen names +bltCmd $graph pen type foo + +echo "done" +bltPlotDestroy $w + -- cgit v0.12