From: Patrick Lynch Date: 2006-10-17T06:29:34+09:00 Subject: Re: CanvasPlot, createPlotAxis and createLinePlot. Patrick Lynch wrote: > Hidetoshi NAGAI wrote: >> >> It seems that the package is constructed with standard canvas items >> only. >> Why don't you translate it to Ruby/Tk? ;-) >> Anyway, translation is not so difficult, if you can read the Perl >> source. >> For example, >> ------------------------------------------------------ >> if ($y_axis) { >> $self->createText( >> $x1-$tl, $y2-$x, -text => $l, >> %args, -fill => $tcolor, >> -font => $lfont, -anchor => $an, >> ); >> } else { >> $self->createText( >> $x+$x1, $y1+$tl, -text => $l, >> %args, -fill => $tcolor, >> -font => $tfont, -anchor => $an, >> ); >> } >> --------------------------------------------------------------- >> ------------------------------------------------------ >> if (y_axis) { >> TkcText.new(self, x1-tl, y2-x, >> args.merge(:text=>l, :fill=>tcolor, >> :font=>lfont, :anchor=>an) >> ) >> } else { >> TkcText.new(self, x+x1, y1+tl, >> args.merge(:text=>l, :fill=>tcolor, >> :font=>tfont, :anchor=>an) >> ) >> } >> --------------------------------------------------------------- >> >> However, if you want to create beautiful graphs, >> I recommend you to use BLT ( or Tcllib(Tklib) ) extension. >> Current Ruby/Tk has a binding for BLT ( and Tcllib(Tklib) ). > > Hidetoshi, > Thank you, I shall try both techniques... > I'm developing a Quality Assurance Metrics package...so I will need do > do some beautiful graphs... > When its done, I will dedicate the graphics portion to you. > Ciao, > Pat I finally got the Perl version of Tk::CanvasPlot up an running -- see the book "Mastering Perl/Tk" by Steve Lidie and Nancy Walsh...I now need to convert this Perl Code to Ruby.... BTW, I tried to make 'BLT' known to one of my Ruby scripts but am unable to do so...Will you please tell me how to do this.... Finally, if anyone is going to use Tk::CanvasPlot in the book mentioned above, give me an email...there is one method that is not included in the text... Good day -- Posted via http://www.ruby-forum.com/.