ANN: SVG::Graph 0.5.1

ANN: SVG::Graph 0.5.1

Post by ser » Thu, 15 Apr 2004 09:55:21


Whelp, that's it.

This release adds the final chart type, TimeSeries, and also adds a
popup feature for displaying the exact value of the data point on Plot
and TimeSeries charts. This feature could also easily be added to
other chart types, if I can think of a good reason for it.

Popups are done with scripting, which was the only way to get it to
work with Batik and KSVG; it doesn't seem to work with the Adobe SVG
plugin under Firefox, but then again, none of the event mechanisms
seemed to work in that case except the most rudimentary clicking. I'd
appreciate feedback about whether it works with the Adobe plugin under
IE, if anybody gets a chance to try it. The SVG TimeSeries screenshot
on the screen shots page has the popups enabled -- just mouse over the
data points and the full date should appear.

There are a couple of other things I want to do, mostly tweaks to
TimeSeries, but it should be mostly complete. Which means that, if it
survives for another month with no major changes, I'll mark it 1.0 and
call it done.

Get it at:

http://www.yqcomputer.com/ ::Graph/

?bientot,

--- SER
 
 
 

ANN: SVG::Graph 0.5.1

Post by Harry Ohls » Thu, 15 Apr 2004 10:39:03

Hi Sean,

When I install from the .tgz (on Windows 2000, running 1.8.1) and try an example from the documentation, I get ...

Can't find module 'SVG/Graph/Graph_Type'

Looking in the SVG/Graph directory of the downloaded source, there is no file called Graph_Type.rb, so I guess the error makes sense.

Here's what happened when I did the "ruby install.rb" which, as you can see, doesn't mention that file. Presumably, it got left out of the tgz somehow? Or am I missing something else ... um, so to speak :-).

Cheers,

Harry O.

Installing in d:/ruby/lib/ruby/site_ruby/1.8
SVG/Graph/TimeSeries.rb -> d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/TimeSeries.rb
chmod 0644 d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/TimeSeries.rb
SVG/Graph/Plot.rb -> d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/Plot.rb
chmod 0644 d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/Plot.rb
SVG/Graph/Pie.rb -> d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/Pie.rb
chmod 0644 d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/Pie.rb
SVG/Graph/Line.rb -> d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/Line.rb
chmod 0644 d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/Line.rb
SVG/Graph/Graph.rb -> d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/Graph.rb
chmod 0644 d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/Graph.rb
SVG/Graph/BarHorizontal.rb -> d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/BarHorizontal.rb
chmod 0644 d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/BarHorizontal.rb
SVG/Graph/BarBase.rb -> d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/BarBase.rb
chmod 0644 d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/BarBase.rb
SVG/Graph/Bar.rb -> d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/Bar.rb
chmod 0644 d:/ruby/lib/ruby/site_ruby/1.8/SVG/Graph/Bar.rb

 
 
 

ANN: SVG::Graph 0.5.1

Post by gabriele r » Thu, 15 Apr 2004 17:06:28

il Wed, 14 Apr 2004 10:39:03 +0900, Harry Ohlsen
< XXXX@XXXXX.COM > ha scritto::



I believe that file existed in older versions, but sean is becoming a
code-machine in this days :)
It seem you can run that example using Graph instead of Graph_Type but
it fails on the last line (for me)
with:
NameError: undefined local variable or method `get_css'
or if I do no_css=true:
NameError: undefined local variable or method `get_y_labels'

btw the sample is also wrong in
fields = %w{ field_1 field_2 field_3 )

the last char should be a }

(running prag prog ruby 1.8.1 on win xp)
 
 
 

ANN: SVG::Graph 0.5.1

Post by ser » Mon, 19 Apr 2004 05:04:36


That example is from the Graph class, and is an example of how you
might subclass the Graph class to create your own type of chart. As
such, it isn't a runnable example. You don't use the Graph class
directly unless you're subclassing it.

Actually, it is silly to have that example in there, because all of
the chart types are better examples of subclassing Graph. However,
the documentation is, by and large, just a Ruby-ized copy of the Perl
documentation, so some cruft is left over.

Use one of the subclasses instead, such as Bar, BarHorizontal, Plot,
Pie, or TimeSeries. They each have examples that should work,
although I admit that I haven't tested those examples. Even better,
look at the programs in the test/ subdirectory; those *do* work.


--- SER