# \[ANN\] Ziya plugin - Charting the rails

**URL:** <https://www.ruby-forum.com/t/ann-ziya-plugin-charting-the-rails/80692>\
**Category:** Rails\
**Created:** [December 30, 2006, 1:15am UTC](https://www.ruby-forum.com/t/ann-ziya-plugin-charting-the-rails/80692 "2006-12-30T01:15:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kitesurfer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@kitesurfer](https://www.ruby-forum.com/u/kitesurfer)\
**Post date:** [December 30, 2006, 1:15am UTC](https://www.ruby-forum.com/t/ann-ziya-plugin-charting-the-rails/80692/1 "2006-12-30T01:15:46Z")

</div>

All,

We’ve just got down with the first implementation of  
ZiYa. This rails plugin allows you to display elegant  
charts on your webapps, the easy way…

Check out at the details at [http://liquidrail.com](http://liquidrail.com).

Best wishes to all for the new year !!

---

<div class="post-metadata">

**Author:** ![kitesurfer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@kitesurfer](https://www.ruby-forum.com/u/kitesurfer)\
**Post date:** [December 30, 2006, 2:08am UTC](https://www.ruby-forum.com/t/ann-ziya-plugin-charting-the-rails/80692/2 "2006-12-30T02:08:37Z")

</div>

Nice plugin, drop dead ugly logo for your site 🙂

On 12/29/06, De Railed [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Best wishes to all for the new year !!
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

## –

## seth at subimage interactive

## [http://www.subimage.com](http://www.subimage.com) [http://sublog.subimage.com](http://sublog.subimage.com)

> **[Freelance Time Tracking Software — Online Invoice Software](https://cashboardapp.com/)**
>
> Freelance time tracking software, online invoice software & project management.
> Used by thousands worldwide since 2007. FREE trial.

[http://dev.subimage.com/projects/substruct](http://dev.subimage.com/projects/substruct)

---

<div class="post-metadata">

**Author:** ![kitesurfer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@kitesurfer](https://www.ruby-forum.com/u/kitesurfer)\
**Post date:** [December 30, 2006, 2:22am UTC](https://www.ruby-forum.com/t/ann-ziya-plugin-charting-the-rails/80692/3 "2006-12-30T02:22:39Z")

</div>

Ha !! Thanks. If you would like to contribute a nice logo we’ll be  
happy to oblige…

---

<div class="post-metadata">

**Author:** ![kitesurfer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@kitesurfer](https://www.ruby-forum.com/u/kitesurfer)\
**Post date:** [December 30, 2006, 3:03pm UTC](https://www.ruby-forum.com/t/ann-ziya-plugin-charting-the-rails/80692/4 "2006-12-30T15:03:53Z")

</div>

Take a look at SWF/XML Charts ( [maani.us](http://www.maani.us/xml_charts/) ) to  
get more info on how the charts are constructed. The answer is “sort  
of”: the Flash chart component reads the XML data when it is rendered  
on the screen (the URL to the XML appears in the HTML which embeds the  
Flash object).

I am glad to see this plugin released as it means there is one less  
thing I have to maintain in my code base. 🙂

V/r  
Anthony

On 12/30/06, devaulw [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Make sure this gets listed on the plugins site. If I understand  
> correctly, this plugin sends down some XML data to the client that gets  
> rendered in a SWF client. Is that right?
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Cell: 808 782-5046  
Current Location: Melbourne, FL

---

<div class="post-metadata">

**Author:** ![kitesurfer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@kitesurfer](https://www.ruby-forum.com/u/kitesurfer)\
**Post date:** [December 30, 2006, 2:38pm UTC](https://www.ruby-forum.com/t/ann-ziya-plugin-charting-the-rails/80692/5 "2006-12-30T14:38:57Z")

</div>

Make sure this gets listed on the plugins site. If I understand  
correctly, this plugin sends down some XML data to the client that gets  
rendered in a SWF client. Is that right?

---

<div class="post-metadata">

**Author:** ![kitesurfer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@kitesurfer](https://www.ruby-forum.com/u/kitesurfer)\
**Post date:** [December 30, 2006, 7:08pm UTC](https://www.ruby-forum.com/t/ann-ziya-plugin-charting-the-rails/80692/6 "2006-12-30T19:08:43Z")

</div>

Thanks !!

We have tried to list the ZiYa plugin in most sites we knew off. If you  
have suggestions  
about other sites, we could list on that would be great.

Indeed ZiYa leverages XML/SWF Charts but hides the XML generation part  
from the  
developer. Within a couple of API calls you should be able to have a  
chart rendered in  
you web app. For instance in you controller you can do something like  
this:

```
def sales
   chart = Ziya::Charts::Bar.new
   chart.add(:axis_category_text, %w{ 2002 2003 2004 2005 2006 })
   chart.add(:series, "Sales", [10, 15, 20, 25, 30])
   render :text => chart
end

```

Then in your view code:

```
<%= gen_chart( "sales_chart",
                 url_for( :controller => 'my_controller', :action =>

```

‘sales’ ),  
“#ffffff”, 400, 300 ) %\>

We’ve also leveraged YAML and ERB to enable you to style the chart  
just like  
you would for HTML and stylesheets. The cool thing here ( so we  
think… ) is  
that you can dynamically style your charts based on some model  
state.  
For example, if you want a certain aspect of the chart to change  
color based  
on some threshold, you could override the style sheet with something  
like this:

\<%=comp :series\_color%\>  
\<%if @options[:sales] \> 10%\>  
colors: ff0000,aa0000  
\<%else%\>  
colors: 0000bb,00cc00  
\<%end%\>

```
 If this looks less than ideal you can also define a ZiYa helper

```

function which would render  
the code above as such:

```
<%=comp :series_color%>
    <%= custom_colors @options[:sales]%>

```

There is more info about that in the rdocs.  
[http://ziya.liquidrail.com/rdoc](http://ziya.liquidrail.com/rdoc).

Thanks for checking us out !!

-Fernand

---

<div class="post-metadata">

**Author:** ![kitesurfer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@kitesurfer](https://www.ruby-forum.com/u/kitesurfer)\
**Post date:** [January 2, 2007, 5:53am UTC](https://www.ruby-forum.com/t/ann-ziya-plugin-charting-the-rails/80692/7 "2007-01-02T05:53:28Z")

</div>

ZiYa Charting Plugin gets a new home.

For issues, discussions, news… please tune in here:

[http://groups.google.com/group/ziya-plugin](http://groups.google.com/group/ziya-plugin)

Be sure to stop on by and register.
