proc setChart { cht valType cats number xlimit ylimit} {
global attName
global aValue
global atts
global target
for {set j 0} {$j < $cats} {incr j} {
set category "Cat-$j"
for { set i 0} {$i < $number} {incr i} {
set x [expr rand() * $xlimit]
set y [expr rand() * $ylimit]
set z [expr rand() * 5]
if { $valType == 1 } {
$cht setXYZValue $category $x $y $z
} elseif { $valType == 2 } {
$cht setCategoryValue $category $i $y
} elseif { $valType == 3 } {
$cht setPieValue "$category-$i" $x
} elseif { $valType == 4 } {
$cht setXYValue $category $x $y
}
}
}
$cht drawChart
}
proc setDateChart { cht } {
$cht setXYDateValue "Cat-1" "2005-10-1" 3
$cht setXYDateValue "Cat-1" "2006-1-2" 5
$cht setXYDateValue "Cat-1" "2006-2-3" 1
$cht setXYDateValue "Cat-1" "2006-3-4" 7
$cht setXYDateValue "Cat-1" "2006-4-4" 2
$cht setXYDateValue "Cat-1" "2006-5-5" 7
$cht setXYDateValue "Cat-1" "2006-6-5" 3
$cht drawChart
}
GuidoForm testGuidoChart {
-default_buttons
-label "Testing GuidoChart"
-layout BoxLayout X_AXIS
-help_id 334
GuidoScrollPane pane {
-height 30
GuidoPanel rightPanel {
-layout Flowlayout
-width 65
-height 95
GuidoChart cht0 {
-width 20
-height 10
-legend true
-chartType "Bar"
-chartTitle "Bar"
-xAxisLabel "x-axis"
-yAxisLabel "y-axis"
-xAxisLabelAngle vertical
-xAxisLabelAngle horizontal
-display_grid false
-display_values false
-action initial {[setChart $cht0 2 5 10 20 30]}
}
GuidoChart cht1 {
-width 20
-height 10
-legend false
-chartType "3D Bar"
-chartTitle "3D Bar"
-xAxisLabelAngle horizontal
-display_grid X false
-display_values true
-action initial {[setChart $cht1 2 2 10 20 30]}
}
GuidoChart cht2 {
-width 20
-height 10
-legend false
-chartType "Stacked Bar"
-chartTitle "Stacked Bar"
-xAxisLabelAngle 45
-display_grid Y false
-display_values true
-action initial {[setChart $cht2 2 5 10 20 30]}
}
GuidoChart cht3 {
-width 20
-height 10
-legend false
-chartType "3D Stacked Bar"
-chartTitle "3D Stacked Bar"
-action initial {[setChart $cht3 2 5 10 20 30]}
}
GuidoChart cht4 {
-width 20
-height 10
-legend false
-chartType "Area"
-chartTitle "Area"
-action initial {[setChart $cht4 2 5 10 20 30]}
}
GuidoChart cht5 {
-width 20
-height 10
-legend false
-chartType "Stacked Area"
-chartTitle "Stacked Area"
-action initial {[setChart $cht5 2 5 10 20 30]}
}
GuidoChart cht6 {
-width 20
-height 10
-legend true
-chartType "Line"
-chartTitle "Line"
-action initial {[setChart $cht6 2 5 10 20 30]}
}
GuidoChart cht20 {
-width 20
-height 10
-legend true
-chartType "3D Line"
-chartTitle "3D Line"
-action initial {[setChart $cht20 2 5 10 20 30]}
}
GuidoChart cht7 {
-width 20
-height 10
-legend true
-chartType "Multiple Pie"
-chartTitle "Multiple Pie"
-action initial {[setChart $cht7 2 2 10 20 30]}
}
GuidoChart cht8 {
-width 20
-height 10
-legend false
-chartType "3D Multiple Pie"
-chartTitle "3D Multiple Pie"
-action initial {[setChart $cht8 2 2 10 20 30]}
}
GuidoChart cht9 {
-width 20
-height 10
-legend false
-chartType "Waterfall"
-chartTitle "Waterfall"
-action initial {[setChart $cht9 2 2 10 20 30]}
}
GuidoChart cht10 {
-width 20
-height 10
-legend false
-chartType "Area XY"
-chartTitle "Area XY"
-action initial {[setChart $cht10 4 5 10 20 30]}
}
GuidoChart cht11 {
-width 50
-height 30
-legend false
-chartType "Line XY"
-chartTitle "Line XY"
-display_grid false
-xAxisLabelAngle vertical
-action initial {[setChart $cht11 4 5 10 20 30]}
}
GuidoChart cht21 {
-width 20
-height 10
-legend false
-chartType "3D Line XY"
-chartTitle "3D Line XY"
-display_grid X false
-action initial {[setChart $cht21 4 5 10 20 30]}
}
GuidoChart cht22 {
-width 20
-height 10
-legend false
-chartType "Bar XY"
-chartTitle "Bar XY"
-display_grid Y false
-action initial {[setChart $cht22 4 5 10 20 30]}
}
GuidoChart cht12 {
-width 20
-height 10
-legend false
-chartType "Polar"
-chartTitle "Polar"
-action initial {[setChart $cht12 4 3 10 360 20]}
}
GuidoChart cht13 {
-width 20
-height 10
-legend false
-chartType "Scatter"
-chartTitle "Scatter"
-action initial {[setChart $cht13 4 5 10 20 30]}
}
GuidoChart cht14 {
-width 20
-height 10
-legend false
-chartType "Time Series"
-chartTitle "Time Series"
-action initial {[setChart $cht14 4 5 10 100000 30]}
}
GuidoChart cht15 {
-width 20
-height 10
-legend false
-chartType "Step Area XY"
-chartTitle "Step Area XY"
-action initial {[setChart $cht15 4 3 10 20 30]}
}
GuidoChart cht16 {
-width 20
-height 10
-legend false
-chartType "Step XY"
-chartTitle "Step XY"
-action initial {[setChart $cht16 4 5 10 20 30]}
}
GuidoChart cht17 {
-width 20
-height 10
-legend false
-chartType "Pie"
-chartTitle "Pie"
-action initial {[setChart $cht17 3 1 10 20 30]}
}
GuidoChart cht18 {
-width 20
-height 10
-legend false
-chartType "3D Pie"
-chartTitle "3D Pie"
-action initial {[setChart $cht18 3 1 10 20 30]}
}
GuidoChart cht19 {
-width 20
-height 10
-legend false
-chartType "Bubble"
-chartTitle "Bubble"
-action initial {[setChart $cht19 1 5 30 20 30]}
}
GuidoChart cht23 {
-width 20
-height 10
-legend false
-chartType "Histogram"
-chartTitle "Histogram"
-display_values true
-action initial {[setChart $cht23 4 5 10 20 30]}
}
GuidoChart cht24 {
-width 20
-height 10
-legend false
-xAxisFormat date
-display_values true
-chartType "Line XY"
-chartTitle "Line XY (Date Axis)"
-xAxisLabelAngle vertical
-action initial {[setDateChart $cht24]}
}
}
}
}
set formStatus [$testGuidoChart interact]
