Class | Tk::BLT::PlotComponent::Axis
In: | tk/lib/tkextlib/blt/component.rb
Parent: | TkObject

### Methods

cget command configinfo configure current_configinfo delete id id2obj invtransform limits name new new to_eval transform use use_as view

### Constants

OBJ_ID | = | ['blt_chart_axis'.freeze, '00000'.taint].freeze
OBJ_TBL | = | {}

### Public Class methods

id2obj(chart, id)

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 333
          def self.id2obj(chart, id)
            cpath = chart.path
            return id unless OBJ_TBL[cpath]
            OBJ_TBL[cpath][id]? OBJ_TBL[cpath][id]: id
          end

new(chart, axis=nil, keys={})

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 349
          def initialize(chart, axis=nil, keys={})
            if axis.kind_of?(Hash)
              keys = axis
              axis = nil
            end
            if axis
              @axis = @id = axis.to_s
            else
              @axis = @id = OBJ_ID.join(TkCore::INTERP._ip_id_).freeze
              OBJ_ID[1].succ!
            end
            @path = @id
            @parent = @chart = chart
            @cpath = @chart.path
            Axis::OBJ_TBL[@cpath][@axis] = self
            keys = _symbolkey2str(keys)
            unless keys.delete('without_creating')
              # @chart.axis_create(@axis, keys)
              tk_call(@chart, 'axis', 'create', @axis, keys)
            end
          end

new(chart, axis=nil, keys={})

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 339
          def self.new(chart, axis=nil, keys={})
            if axis.kind_of?(Hash)
              keys = axis
              axis = nil
            end
            OBJ_TBL[chart.path] = {} unless OBJ_TBL[chart.path]
            return OBJ_TBL[chart.path][axis] if axis && OBJ_TBL[chart.path][axis]
            super(chart, axis, keys)
          end

### Public Instance methods

cget(option)

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 379
          def cget(option)
            @chart.axis_cget(@id, option)
          end

command(cmd=nil, &b)

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 393
          def command(cmd=nil, &b)
            if cmd
              configure('command', cmd)
            elsif b
              configure('command', Proc.new(&b))
            else
              cget('command')
            end
          end

configinfo(key=nil)

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 386
          def configinfo(key=nil)
            @chart.axis_configinfo(@id, key)
          end

configure(key, value=None)

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 382
          def configure(key, value=None)
            @chart.axis_configure(@id, key, value)
            self
          end

current_configinfo(key=nil)

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 389
          def current_configinfo(key=nil)
            @chart.current_axis_configinfo(@id, key)
          end

delete()

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 403
          def delete
            @chart.axis_delete(@id)
            self
          end

id()

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 371
          def id
            @id
          end

invtransform(val)

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 408
          def invtransform(val)
            @chart.axis_invtransform(@id, val)
          end

limits()

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 412
          def limits
            @chart.axis_limits(@id)
          end

name()

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 416
          def name
            @axis
          end

to_eval()

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 375
          def to_eval
            @id
          end

transform(val)

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 420
          def transform(val)
            @chart.axis_transform(@id, val)
          end

use(name=None)

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 429
          def use(name=None) # if @id == xaxis | x2axis | yaxis | y2axis
            @chart.axis_use(@id, name)
          end

use_as(axis)

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 433
          def use_as(axis) # axis := xaxis | x2axis | yaxis | y2axis
            @chart.axis_use(axis, @id)
          end

view()

[Source]

    # File tk/lib/tkextlib/blt/component.rb, line 424
          def view
            @chart.axis_view(@id)
            self
          end

[Validate]