Class: Tk::Tcllib::Plotchart::Gnattchart

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

### Methods

color_of_part connect font_of_part milestone new summary task vertline

### Included Modules

ChartMethod

### Constants

TkCommandNames | = | [ 'canvas'.freeze, '::Plotchart::createGnattchart'.freeze

### Public Class methods

new(*args)

[Source]

    # File tk/lib/tkextlib/tcllib/plotchart.rb, line 744
        def initialize(*args)
          # args := ([parent,] time_begin, time_end, items [, text_width] [, keys])
          # time_begin := String of time format (e.g. "1 january 2004")
          # time_end   := String of time format (e.g. "1 january 2004")
          # items := Expected/maximum number of items
          #          ( This determines the vertical spacing. )
          if args[0].kind_of?(String)
            @time_begin = args.shift
            @time_end   = args.shift
            @items      = args.shift

            if args[0].kind_of?(Fixnum)
              @text_width = args.shift
            else
              @text_width = None
            end

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

            @time_begin = args.shift
            @time_end   = args.shift
            @items      = args.shift

            if args[0].kind_of?(Fixnum)
              @text_width = args.shift
            else
              @text_width = None
            end

            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_of_part(keyword, newcolor)

[Source]

    # File tk/lib/tkextlib/tcllib/plotchart.rb, line 823
        def color_of_part(keyword, newcolor)
          tk_call_without_enc(@chart, 'color', keyword, newcolor)
          self
        end

connect(from_task, to_task)

[Source]

    # File tk/lib/tkextlib/tcllib/plotchart.rb, line 809
        def connect(from_task, to_task)
          from_task = array2tk_list(from_task) if from_task.kind_of?(Array)
          to_task   = array2tk_list(to_task)   if to_task.kind_of?(Array)

          tk_call_without_enc(@chart, 'connect', from_task, to_task)
          self
        end

font_of_part(keyword, newfont)

[Source]

    # File tk/lib/tkextlib/tcllib/plotchart.rb, line 828
        def font_of_part(keyword, newfont)
          tk_call_without_enc(@chart, 'font', keyword, newfont)
          self
        end

milestone(txt, time, col=None)

[Source]

    # File tk/lib/tkextlib/tcllib/plotchart.rb, line 799
        def milestone(txt, time, col=None)
          tk_call_without_enc(@chart, 'milestone', txt, time, col)
          self
        end

summary(txt, tasks)

[Source]

    # File tk/lib/tkextlib/tcllib/plotchart.rb, line 817
        def summary(txt, tasks)
          tasks = array2tk_list(tasks) if tasks.kind_of?(Array)
          tk_call_without_enc(@chart, 'summary', tasks)
          self
        end

task(txt, time_begin, time_end, completed=0.0)

[Source]

    # File tk/lib/tkextlib/tcllib/plotchart.rb, line 792
        def task(txt, time_begin, time_end, completed=0.0)
          list(tk_call_without_enc(@chart, 'task', txt, time_begin, time_end,
                                   completed)).collect!{|id|
            TkcItem.id2obj(self, id)
          }
        end

vertline(txt, time)

[Source]

    # File tk/lib/tkextlib/tcllib/plotchart.rb, line 804
        def vertline(txt, time)
          tk_call_without_enc(@chart, 'vertline', txt, time)
          self
        end

[Validate]