Open Flash Chart 2 plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install git://github.com/korin/open_flash_chart_2_plugin.git
Example of usage
=====================================
include js file in loyout or anything else where you need that:
= javascript_include_tag 'swfobject.js'
in some conroller:
class SomeController < ApplicationController def funny_action #width, height, link to data @graph = ofc2(650,300, "charts_ofc2/line") end end
in charts_ofc2 conroller:
class ChartsOfc2Controller < ApplicationController def line title = OFC2::Title.new( DateTime.now.strftime('%Y-%m-%d %H:%M'), "{font-size: 14px; color: #b50F0F; text-align: center;}") line_dot = OFC2::Line.new line_dot.values= [9,8,7,6,5,4,3,2,1] chart = OFC2::Graph.new chart.title= title chart << line_dot render :text => chart.render end end
in views/some/funny_action.haml view
= @graph
That's it, try it.
If You have trouble try sample application (info below), or ask on google groups.
Get sample application
=====================================
Grab whole sample application:
go to directory where you want create sample application
git clone git://github.com/korin/open_flash_chart_2.git
install plugin (instruction is above)
customize database.yml
customize what you want ;)
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, 2 months ago

