[wxruby-users] chart extension for wxRuby?

Ellis, Peter
Thu, 31 Jan 2008 18:13:09 -0000

Thanks, Alex.

I was hoping that we wouldn''t have to create our own, but we might do
it
if that turns out to be the best solution.  I''ll keep the list posted.

I did find this project, but it looks dead.
http://rubyforge.org/projects/wxryplot/
http://files.rubyforge.vm.bytemark.co.uk/wxryplot/WxRyPlot.doc

P

-----Original Message-----
From: wxruby-users-bounces at rubyforge.org
[mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton
Sent: Thursday, January 31, 2008 12:07 AM
To: General discussion of wxRuby
Subject: Re: [wxruby-users] chart extension for wxRuby?

Ellis, Peter wrote:
> Does anyone know of a chart making extension written with wxRuby?  I
> know there are a few Ruby gems out there to make charts (as SVG or an
> image), but they seem to have a lot of overhead associated with them.
> The ones I''ve found that seem most interesting (Gruff, Scruffy,
gnuplot)
> require a big bulky graphics/image processing library to be installed.
> Seems like wxRuby has all the pieces one would need to make a nice
chart
> API or custom chart widget,
Yes, all the pieces should be there. There are several charting
libraries written in C++ for wxWidgets which might offer a good starting

point [1]

Basically, you use a DC (DeviceContext) to draw lines, polygons,
ellipses, text etc. DC can draw images from files and do textured fills.

Wx::Grid would be an excellent component for editing and viewing the
source data points.

The target canvas can be either the screen (using Window#paint to create

a PaintDC), or a bitmap (using Bitmap#draw to create a MemoryDC). The
same actual drawing code is used regardless of the target. Once the
drawing''s been done on a bitmap, call Bitmap.save_file to save the
image

to a variety of formats, including BMP, PNG, TIF or JPG.

For higher-quality output there''s also GraphicsContext, which can be
created by calling GraphicsDC.create(dc) from any other DC. This will
give anti-aliased edges and also offers gradient fills but is otherwise
very similar.
> although probably without the SVG, which is fine for my purposes.
>
There''s an SVG-writer as an optional contrib-module in the main
wxWidgets tree, which allows DC drawing code to be output as SVG. This
isn''t currently porrted to wxRuby, but if there''s interest we
could have

a look at adding it.

In my day job I do a lot of charting in Excel and SPSS so I''d be
interested to hear how it goes if you decide to pursue this.

cheers
alex

[1]
http://wxcode.sourceforge.net/complist.php?compperpage=1000&viewmode=ful
l&browseby=category&section=graphics&page=1



_______________________________________________
wxruby-users mailing list
wxruby-users at rubyforge.org