id2obj(chart, id)
click to toggle source
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={})
click to toggle source
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
new(chart, axis=nil, keys={})
click to toggle source
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')
tk_call(@chart, 'axis', 'create', @axis, keys)
end
end
cget(option)
click to toggle source
def cget(option)
@chart.axis_cget(@id, option)
end
command(cmd=nil, &b)
click to toggle source
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)
click to toggle source
def configinfo(key=nil)
@chart.axis_configinfo(@id, key)
end
current_configinfo(key=nil)
click to toggle source
def current_configinfo(key=nil)
@chart.current_axis_configinfo(@id, key)
end
delete()
click to toggle source
def delete
@chart.axis_delete(@id)
self
end
id()
click to toggle source
limits()
click to toggle source
def limits
@chart.axis_limits(@id)
end
name()
click to toggle source
to_eval()
click to toggle source
use(name=None)
click to toggle source
def use(name=None)
@chart.axis_use(@id, name)
end
use_as(axis)
click to toggle source
def use_as(axis)
@chart.axis_use(axis, @id)
end
view()
click to toggle source
def view
@chart.axis_view(@id)
self
end