Ignore:
Timestamp:
Feb 21, 2011, 11:03:45 PM (16 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
003b0ec
Parents:
cf594ab
Message:

refs #466, show the name of the closest line in a timeserie graph

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3221 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/toltk/bysgraph.tcl

    rcf594ab raf3f4af  
    543543  upvar \#0 ${this}::widgets widgets
    544544  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]
    550559    } else {
    551560      set label "X = $t, Y = $z"
Note: See TracChangeset for help on using the changeset viewer.