- Timestamp:
- Feb 21, 2011, 11:03:45 PM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 003b0ec
- Parents:
- cf594ab
- Location:
- tolbase/lib/toltk
- Files:
-
- 2 edited
-
bysgraph.tcl (modified) (1 diff)
-
sergraph.tcl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/toltk/bysgraph.tcl
rcf594ab raf3f4af 543 543 upvar \#0 ${this}::widgets widgets 544 544 upvar \#0 ${this}::data data 545 if [$widgets(gr,$numGraph) inside $x $y] { 546 set t [expr round([$widgets(gr,$numGraph) axis invtransform x $x])] 547 set z [format "%.2f" [$widgets(gr,$numGraph) axis invtransform y $y]] 548 if [info exists ${this}::data(proc,OnGetLabel)] { 549 set label [$data(proc,OnGetLabel) $this $widgets(gr,$numGraph) $t $z] 545 546 set graph $widgets(gr,$numGraph) 547 if { [ $graph inside $x $y ] } { 548 #set t [expr round([$widgets(gr,$numGraph) axis invtransform x $x])] 549 set t [ $graph axis invtransform x $x ] 550 set z [ format "%.2f" [ $graph axis invtransform y $y ] ] 551 if { [ info exists ${this}::data(proc,OnGetLabel) ] } { 552 if { [$graph element closest $x $y infoLine -interpolate yes] } { 553 set nameLine $infoLine(name) 554 } else { 555 set nameLine "" 556 } 557 set label [$data(proc,OnGetLabel) \ 558 $this $graph $nameLine $t $z] 550 559 } else { 551 560 set label "X = $t, Y = $z" -
tolbase/lib/toltk/sergraph.tcl
rcf594ab raf3f4af 10 10 namespace eval ::SeriesGraph { 11 11 variable tmpOpt 12 } 13 14 proc ::SeriesGraph::ShowSerieInfo { Instance graph x y } { 15 upvar \#0 ${Instance}::widgets widgets 16 upvar \#0 ${Instance}::data data 17 18 if ![$graph element closest $x $y info -interpolate yes] { 19 beep 20 return 21 } 22 parray info 23 } 24 25 proc ::SeriesGraph::BindSerieInfo { Instance } { 26 upvar \#0 ${Instance}::widgets widgets 27 upvar \#0 ${Instance}::data data 28 29 set graph $widgets(gr,0) 30 bind closest-point-$graph <Control-ButtonPress-2> \ 31 [ string map [list %I $Instance] { 32 ::SeriesGraph::ShowSerieInfo %I %W %x %y 33 } ] 34 blt::AddBindTag $graph closest-point-$graph 35 12 36 } 13 37 … … 38 62 upvar \#0 ${Instance}::widgets widgets 39 63 upvar \#0 ${Instance}::data data 64 65 #::SeriesGraph::BindSerieInfo $Instance 66 #Blt_ClosestPoint $widgets(gr,0) 40 67 41 68 set data(namespace) SeriesGraph … … 125 152 $grpath line configure l$i-$j -label "" 126 153 } else { 127 $grpath line configure l$i-0 -label [$sergrp serie $i name] 154 set nameSerie [$sergrp serie $i name] 155 $grpath line configure l$i-0 -label $nameSerie 156 set data(labels,l$i) $nameSerie 128 157 } 129 158 incr j … … 308 337 309 338 #///////////////////////////////////////////////////////////////////////////// 310 proc ::SeriesGraph::GetLabel { this bltg tick y} {339 proc ::SeriesGraph::GetLabel { this bltg name tick y} { 311 340 # 312 341 #///////////////////////////////////////////////////////////////////////////// … … 314 343 set gr $data(gr,active) 315 344 316 if [string is int $tick] {317 set str ""318 catch {319 set str [$data(gr,$gr,sergrp) dating $tick]320 }321 set label "t = $str, z = $y"322 } else {323 set label "t = $tick, z = $y"324 } 325 return $label345 set t [ expr {round($tick)} ] 346 if { [ catch { $data(gr,$gr,sergrp) dating $t } labelTick ] } { 347 set labelTick $tick 348 } 349 if { [ regexp {(l[0-9])+(-[0-9])*} $name ==> codeLine ] } { 350 set nameLine $data(labels,$codeLine) 351 } else { 352 set nameLine "NO LINE" 353 } 354 return "$nameLine: ($labelTick,$y)" 326 355 } 327 356
Note: See TracChangeset
for help on using the changeset viewer.
