pizza_chart 2.0.0
Hi all, This gem customizes the existing gem => lazy high charts and depends on the lazy high charts gem. Step 1 : Please include this gem with 'lazy_high_charts' gem in your gemfile, which is dependent on it. gem 'lazy_high_charts' gem 'pizza_chart' Step 2 : And inculde below items in appliction.js file of app->assets->javascript //= require jquery //= require jquery_ujs //= require_tree . //= require turbolinks //= require highcharts/highcharts //= require highcharts/highcharts-more //= require highcharts/highstock Step 3: Bundel install Step 4: Then in controller, add below def index x_axis_name = ['chicken', 'pepporoni', 'ham'] #x axis variable which you would like to see y_axis_data_1 = [4,5,6] #data to be shown in the bar y_axis_name_1 = original price #name on top the bar y_axis_data_2 = [1,2,3] #another array of data to be shown in the bar with comparision to data 1 y_axis_name_2 = offered price #name on top the bar chart_type = bar #chart type which you would like to see for the data. #Available mothods of Charts are : pie, line, bar and spline #pass the required values, this method returns the object of graph controller #for single array data @chart = Charting.singlechart(x_name, y_data_1, y_name_1, chart_type) #for two array data @chart = Charting.doublechart(x_axis_name, y_axis_data_1, y_axis_name_1, y_axis_data_2, y_axis_name_2, chart_type) #for three array data @chart = Charting.multichart(x_name, y_data_1, y_name_1, y_data_2, y_name_2, y_data_3, y_name_3, chart_type) #for two array data with combination of multi design chart type @chart = Charting.function_chart(x_name, y_data_1, y_name_1, y_data_2, y_name_2, chart_type) end Step 5: In you view just copy the below code and put qutoes between your div id. <h1>Charts</h1> <%= high_chart(''div_id'', @chart) %> Step 6: If not working, I am sorry. Google it out. Thanks for the visit. Good luck.