Tcl Library Source Code

Ticket Change Details
Login
Overview

Artifact ID: 8e2ae8efd2a1950a27dd201b11303db5544c74fd
Ticket: 1903306fffffffffffffffffffffffffffffffff
xyplot xconfig / yconfig -scale not working
User & Date: arjenmarkus 2014-09-21 13:59:10
Changes

  1. comment changed to:
    Using the xconfig or yconfig command with the -scale option results in an "Unknown or invalid value" error.
    
    Script showing problem:
    
    package require Tk
    package require Plotchart
    
    canvas .c
    pack .c
    
    set s [Plotchart::createXYPlot .c {0 100 10} {0 100 10}]
    $s xconfig -scale {0 200 20}
    
    
    The problem is in Plotchart::AxisConfig, in the file plotaxis.tcl around line 492.  The "idx" value is the index into a list with a single value per option, and it is used to index into the axis_option_values which has two values per option.  One possible fix is to multiply the idx by 2 before using it on the axis_option_values.
    
      set clear   [lindex  $axis_option_clear  $idx]
    >>  set idx [expr {2 * $idx}]
      set values  [lindex  $axis_option_values [incr idx]]
    
    
    Also, in the plotaxis.tcl file there is "console show" and "puts" command in the Plotchart::DrawXaxis routine which seem out of place.
    
    Thanks,
    -paul
    
  2. icomment:
    The error has been solved, but the effect is not quite what one would expect: the axis is not completely redefined. This needs to be investigated.
    
  3. login: "arjenmarkus"
  4. mimetype: "text/plain"
  5. severity changed to: "Minor"