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
            

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.