Class | Fusioncharts::ArrayExampleController |
In: |
app/controllers/fusioncharts/array_example_controller.rb
|
Parent: | ApplicationController |
This controller class will show ways of generating chart by
All the views related to this controller will use the "common" layout. As per Ruby On Rails conventions, we have the corresponding views with the same name as the function name in the controller.
In this function, we plot a Combination chart from data contained in an array. Each element in the array will have three values - first one for Quarter Name second one for sales figure and third one for quantity. These values in the array will be used by the builder to build an appropriate xml, which is then rendered by the corresponding view.
In this function, we plot a multi-series chart from data contained in an array. Each element in the array will have three values - first one for data label (product) and the next one store sales information for current year and the last one stores sales information for previous year. The sales data and product names for 6 products are thus, stored. These values in the array will be used by the builder to build an appropriate xml, which is then rendered by the corresponding view.
In this function, we plot a single series chart from data contained in an array. Each element in the array will have two values - first one for data label and the next one for data value. The sales data and product names for 6 products are stored in the array. These values in the array will be used by the builder to build an appropriate xml, which is then rendered by the corresponding view.