- The one I will go over in this article.
- Change data on the fly with links - Discussed in Part2.
- Update and Save data.
- Ajax calls to server - Discussed in Part 3.
- Manipulate the data through an interface.
- Some really cool interfaces.
Here is the graph we are after in this example:
More Open Flash Chart II examples.
And here is the code (the controller):
1 2 3 4 5 6 7 8 9 10 11
class TestItController < ApplicationController def index title = Title.new("MY TITLE") bar = BarGlass.new bar.set_values([1,2,3,4,5,6,7,8,9]) @chart = OpenFlashChart.new @chart.set_title(title) @chart.add_element(bar) end end
And in your view (index.html.erb):
1 2 3 4 5 6 7 8 9
I do a lot behind the scenes but if you look, you will see a few new things here.
- If you look at the HTML source, it is quite a bit different, we simply embed the SWF object. We do not need to point to the data method since there actually isn't one.
Good Luck! and Harry, I hope this helps, otherwise please drop me a line.