views:

308

answers:

3

I'm implementing charts using The Ziya Charts Gem. Unfortunately, the documentation isn't really helpful or I haven't had enough coffee to figure out theming. I know I can set a theme using

chart.add(:theme, 'whatever')

Problem: I haven't found any predefined themes, nor have I found a reference to the required format.

A: 

To partly answer my own question, there are some themes in the website sources which can be checked out at

svn co svn://rubyforge.org/var/svn/liquidrail/samples/charting

(then go to /public/charts/themes/)

MattW.
+1  A: 

As I understand it, the themes are used by initializing the theme directory in your ziya.rb file like so:

Ziya.initialize(:themes_dir => File.join( File.dirname(__FILE__), %w[.. .. public charts themes]) )

And you'll need to set up the proper directory, in this case public/charts/themes. It doesn't come with any in there to start with as I recall. Are you having problems past this?

PJ
No, I got it working now. Already had the initialization in place, was just missing content for the themes directory. Now happily fiddling around with colors and font sizes.
MattW.
A: 

If you install the ZiYa plug-in into your Rails application there should be a themes directory where you said. Just copy one of the existing themes, change its name to whatever you want, and then modify it however you like.

Another options for nice Flash charts is Open Flash Chart. I moved from Ziya/SWF Charts to Open Flash Chart when working on Flash charts in a Rails app I was working on. There is also a Rails plug-in for Open Flash Chart. Besides the fact that it is easier to work with, Open Flash Chart is open source, so if you can hack Flash you can customize it.

Ryan Leavengood
Thanks for the idea, but I need polar (radar/spider) charts, which OFC doesn't have. Could add it I guess, but don't feel like learning flash right now.
MattW.