Easy as Pie High Charts

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


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


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"}))


In the view


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

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



Copyright © 2010 Jeff Sutherland. See LICENSE for details.