Ziya is pretty cool, and the documentation is slowly starting to surface. I was annoyed that I couldn’t find a good example paste of how to make a line chart. Then I watched the screencast. It’s the first example he does, so I’m posting it here so those who can’t watch it can actually find out how to do it.
I’m going to operate on the precondition that you’ve installed Ziya and included it in your controller properly. Do the bar chart example before going any further.
Now, make this function in your controller:
def refresh_chart
chart = ZIya::Charts::Line.new
render :text => chart
end
I saw a post on Digg that caught my eye, and thought that this might be another way to gauge the amount of hardcore supporters each popular candidate has. I picked the following:
Now, you would think that the number of hardcore supporters should correlate nicely with the number of voters turning out in the primaries since one should think that anyone in a Meetup group would go vote come primary day. But, sadly, by the looks of it very few of the supporters of the “top-tier” Republican candidates are enthusiastic enough to join a Meetup group. I wonder why since this would help their campaigns immensely. Here’s the result:
Maybe they’re all just using a different site? Let me know what you think.
I decided today that I wanted to track my calories burned per day on a nice line graph. I did it, and I think I will continue. The total is automatically calculated by the PHP data source. This was made using my Mephisto Plugin for Open Flash Charts.