In Files

  • tk/lib/tkextlib/tcllib/plotchart.rb

Class/Module Index [+]

Quicksearch

Tk::Tcllib::Plotchart::Plot3D

Constants

TkCommandNames

Public Class Methods

new(*args) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 676
def initialize(*args) # args := ([parent,] xaxis, yaxis, zaxis [, keys])
                      # xaxis := Array of [minimum, maximum, stepsize]
                      # yaxis := Array of [minimum, maximum, stepsize]
                      # zaxis := Array of [minimum, maximum, stepsize]
  if args[0].kind_of?(Array)
    @xaxis = args.shift
    @yaxis = args.shift
    @zaxis = args.shift

    super(*args) # create canvas widget
  else
    parent = args.shift

    @xaxis = args.shift
    @yaxis = args.shift
    @zaxis = args.shift

    if parent.kind_of?(Tk::Canvas)
      @path = parent.path
    else
      super(parent, *args) # create canvas widget
    end
  end

  @chart = _create_chart
end
            

Public Instance Methods

color(fill, border) click to toggle source
Alias for: colour
colors(fill, border) click to toggle source
Alias for: colour
colour(fill, border) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 757
def colour(fill, border)
  # configure the colours to use for polygon borders and inner area
  tk_call_without_enc(@chart, 'colour', fill, border)
  self
end
            
Also aliased as: colours, colors, color
colours(fill, border) click to toggle source
Alias for: colour
grid_size(nxcells, nycells) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 725
def grid_size(nxcells, nycells)
  tk_call_without_enc(@chart, 'gridsize', nxcells, nycells)
  self
end
            
plot_data(dat) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 739
def plot_data(dat)
  # dat has to be provided as a 2 level array.
  # 1st level contains rows, drawn in y-direction,
  # and each row is an array whose elements are drawn in x-direction,
  # for the columns.
  tk_call_without_enc(@chart, 'plotdata', dat)
  self
end
            
plot_funcont(conts, cmd=Proc.new) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 718
def plot_funcont(conts, cmd=Proc.new)
  conts = array2tk_list(conts) if conts.kind_of?(Array)
  Tk.ip_eval("proc #{@path}_#{@chart} {x y} {#{install_cmd(cmd)} $x $y}")
  tk_call_without_enc(@chart, 'plotfuncont', "#{@path}_#{@chart}", conts)
  self
end
            
plot_function(cmd=Proc.new) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 712
def plot_function(cmd=Proc.new)
  Tk.ip_eval("proc #{@path}_#{@chart} {x y} {#{install_cmd(cmd)} $x $y}")
  tk_call_without_enc(@chart, 'plotfunc', "#{@path}_#{@chart}")
  self
end
            
plot_line(dat, color) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 730
def plot_line(dat, color)
  # dat has to be provided as a 2 level array.
  # 1st level contains rows, drawn in y-direction,
  # and each row is an array whose elements are drawn in x-direction,
  # for the columns.
  tk_call_without_enc(@chart, 'plotline', dat, color)
  self
end
            
zconfig(key, value=None) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 748
def zconfig(key, value=None)
  if key.kind_of?(Hash)
    tk_call_without_enc(@chart, 'zconfig', *hash_kv(key, true))
  else
    tk_call(@chart, 'zconfig', "-#{key}", value)
  end
  self
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.