Skip to content

drpentode/pie-high

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easy as Pie High Charts

This gem gives you an easy-as-pie Ruby interface to High Charts.

Usage

I really hate to say this, but at version 0.1.0, the documentation is the code comments. More to follow as I expand this gem.

In the controller

<tt>

require "high_chart"
require "high_chart_series"
@data_set = DataSet.find(:all)
@series = HighChartSeries.multi_series("name", "data", @data_set)
@my_chart = HighChart.new(@series,
                               {:title => "The Best Chart Ever", :x_axis_labels => ["Like", "Dislike", "Indifferent"], :y_axis_title => "Comparison of Apples to Oranges"}))

</tt>

In the view

<tt>

<script type="text/javascript">
    $(document).ready(function() {
        chart1 = new Highcharts.Chart(
            <%= @my_chart.to_json %>
        );
    });
</script>

<div id="high-chart-container" style="width: 100%; height: 400px"></div>

</tt>

Copyright © 2010 Jeff Sutherland. See LICENSE for details.

About

An easy-as-pie Ruby interface to High Charts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages