A Closer Look at ZiYa – The Flash Chart Plugin For Rails
Just a few weeks ago, a new Rails chart system called ZiYa was briefly mentioned on Ruby Inside. ZiYa is unique in that it can render graphically complex charts from data in your Rails application with a bare minimum of code. The layout and style of the charts is defined via special YAML stylesheets, sprinkled with a bare minimum of Ruby code.
Since ZiYa was first mentioned here, a lot has happened with it. ZiYa's official site is now full of comprehensive samples and documentation, and even a screencast is available demonstrating how to get a ZiYa chart working in just several minutes. Given all of these developments, I thought I'd ask lead developer Fernand Galiana a few questions about ZiYa.
Ruby Inside: What was the motivation behind developing ZiYa?
Fernand Galiana: I work for a company that deals with financial data where charts are worth a thousand words. We always get requests for various charts, and in the past we've used Gruff to produce them. Gruff is a great library and the results look good too! However, recently we've have more demanding requirements to provide more dynamic behavior on the charts. Users wanted to be able to interact with the charts in various ways and drill down to gather more information.
We looked at alternatives to Gruff, and decided to go with XML/SWF charts. This framework uses Flash rendering for charts and has great features, 24hr turnaround support and it's inexpensive. The other advantage is that we no longer had to deal with figuring out the various incantations to install RMagick on various servers. Moreover, we were able to delegate the actual chart rendering over to the client, which with dynamic graphs is key. All we had to do now on the server side is generate XML. This is what triggered the initial thoughts of leveraging Ruby to generate this XML.
The other motivation occurred when we wrote an internal reporting app that give us up to date information on what's going on in our database. My boss bought a nice 32" TFT flat panel. All day we cycle through various graphs representing critical data from our database. If something goes off in our internal processing, we all see it right there on the big screen! This is where the YAML style sheet idea came about as we wanted to create a special look and feel and since creating and customizing many different charts was a necessary feature, using style sheets makes it easy.
Where do you see ZiYa going in future?
We have a few clean-up and housekeeping items on the list. I was also thinking about adding more out of the box helpers for the YAML stylesheets. And, naturally, more docs and tutorials are always good.
Are there are any interesting uses of ZiYa you've seen elsewhere so far?