276
def contourlines(xcrd, ycrd, vals, clss=None)
277
xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
278
ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
279
vals = array2tk_list(vals) if vals.kind_of?(Array)
280
clss = array2tk_list(clss) if clss.kind_of?(Array)
282
tk_call_without_enc(@chart, 'contourlines', xcrd, ycrd, vals, clss)
286
def contourfill(xcrd, ycrd, vals, klasses=None)
287
xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
288
ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
289
vals = array2tk_list(vals) if vals.kind_of?(Array)
290
clss = array2tk_list(clss) if clss.kind_of?(Array)
292
tk_call_without_enc(@chart, 'contourfill', xcrd, ycrd, vals, clss)
296
def contourbox(xcrd, ycrd, vals, klasses=None)
297
xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
298
ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
299
vals = array2tk_list(vals) if vals.kind_of?(Array)
300
clss = array2tk_list(clss) if clss.kind_of?(Array)
302
tk_call_without_enc(@chart, 'contourbox', xcrd, ycrd, vals, clss)
306
def color_map(colors)
307
colors = array2tk_list(colors) if colors.kind_of?(Array)
309
tk_call_without_enc(@chart, 'colorMap', colors)
313
def grid_cells(xcrd, ycrd)
314
xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
315
ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
317
tk_call_without_enc(@chart, 'grid', xcrd, ycrd)
275
321
def dataconfig(series, key, value=None)
276
322
if key.kind_of?(Hash)
277
323
tk_call_without_enc(@chart, 'dataconfig', series, *hash_kv(key, true))
528
def plot_funcont(conts, cmd=Proc.new)
529
conts = array2tk_list(conts) if conts.kind_of?(Array)
530
Tk.ip_eval("proc #{@path}_#{@chart} {x y} {#{install_cmd(cmd)} $x $y}")
531
tk_call_without_enc(@chart, 'plotfuncont', "#{@path}_#{@chart}", conts)
482
535
def grid_size(nxcells, nycells)
483
536
tk_call_without_enc(@chart, 'gridsize', nxcells, nycells)
682
735
############################
736
class Gnattchart < TkCanvas
741
'::Plotchart::createGnattchart'.freeze
744
def initialize(*args)
745
# args := ([parent,] time_begin, time_end, items [, text_width] [, keys])
746
# time_begin := String of time format (e.g. "1 january 2004")
747
# time_end := String of time format (e.g. "1 january 2004")
748
# items := Expected/maximum number of items
749
# ( This determines the vertical spacing. )
750
if args[0].kind_of?(String)
751
@time_begin = args.shift
752
@time_end = args.shift
755
if args[0].kind_of?(Fixnum)
756
@text_width = args.shift
761
super(*args) # create canvas widget
765
@time_begin = args.shift
766
@time_end = args.shift
769
if args[0].kind_of?(Fixnum)
770
@text_width = args.shift
775
if parent.kind_of?(TkCanvas)
778
super(parent, *args) # create canvas widget
782
@chart = _create_chart
786
p self.class::TkCommandNames[1] if $DEBUG
787
tk_call_without_enc(self.class::TkCommandNames[1], @path,
788
@time_begin, @time_end, @items, @text_width)
790
private :_create_chart
792
def task(txt, time_begin, time_end, completed=0.0)
793
list(tk_call_without_enc(@chart, 'task', txt, time_begin, time_end,
794
completed)).collect!{|id|
795
TkcItem.id2obj(self, id)
799
def milestone(txt, time, col=None)
800
tk_call_without_enc(@chart, 'milestone', txt, time, col)
804
def vertline(txt, time)
805
tk_call_without_enc(@chart, 'vertline', txt, time)
809
def connect(from_task, to_task)
810
from_task = array2tk_list(from_task) if from_task.kind_of?(Array)
811
to_task = array2tk_list(to_task) if to_task.kind_of?(Array)
813
tk_call_without_enc(@chart, 'connect', from_task, to_task)
817
def summary(txt, tasks)
818
tasks = array2tk_list(tasks) if tasks.kind_of?(Array)
819
tk_call_without_enc(@chart, 'summary', tasks)
823
def color_of_part(keyword, newcolor)
824
tk_call_without_enc(@chart, 'color', keyword, newcolor)
828
def font_of_part(keyword, newfont)
829
tk_call_without_enc(@chart, 'font', keyword, newfont)
834
############################
683
835
class PlotSeries < TkObject
684
836
SeriesID_TBL = TkCore::INTERP.create_table
685
837
Series_ID = ['series'.freeze, '00000'.taint].freeze