Class Tk::Tcllib::Plotchart::Plot3D
In: tk/lib/tkextlib/tcllib/plotchart.rb
Parent: TkCanvas

Methods

color   colors   colour   colours   grid_size   new   plot_data   plot_function  

Included Modules

ChartMethod

Constants

TkCommandNames = [ 'canvas'.freeze, '::Plotchart::create3DPlot'.freeze

Public Class methods

[Source]

# File tk/lib/tkextlib/tcllib/plotchart.rb, line 435
    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?(TkCanvas)
          @path = parent.path
        else
          super(parent, *args) # create canvas widget

        end
      end

      @chart = _create_chart
    end

Public Instance methods

color(fill, border)

Alias for colour

colors(fill, border)

Alias for colour

[Source]

# File tk/lib/tkextlib/tcllib/plotchart.rb, line 491
    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
colours(fill, border)

Alias for colour

[Source]

# File tk/lib/tkextlib/tcllib/plotchart.rb, line 477
    def grid_size(nxcells, nycells)
      tk_call_without_enc(@chart, 'gridsize', nxcells, nycells)
      self
    end

[Source]

# File tk/lib/tkextlib/tcllib/plotchart.rb, line 482
    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

[Source]

# File tk/lib/tkextlib/tcllib/plotchart.rb, line 471
    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

[Validate]