Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more

In Files

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

Class/Module Index [+]

Quicksearch

Tk::Tcllib::Plotchart::Barchart3D

Constants

TkCommandNames

Public Class Methods

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

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

    @yaxis = args.shift
    @nobars = 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

config(key, value=None) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 812
def config(key, value=None)
  if key.kind_of?(Hash)
    tk_call_without_enc(@chart, 'config', *hash_kv(key, true))
  else
    tk_call(@chart, 'config', "-#{key}", value)
  end
  self
end
            
plot(label, yvalue, color) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 806
def plot(label, yvalue, color)
  tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(label),
                      _get_eval_enc_str(yvalue), color)
  self
end