Class | Fusioncharts::DbJsController |
In: |
app/controllers/fusioncharts/db_js_controller.rb
|
Parent: | ApplicationController |
In this controller, we will plot a pie-chart showing total output of quantities and name of each factory in a pie-section. On clicking on a pie-section, we obtain detailed information on the quantity produced and date of production of the factory by using javascript.
In this action, the total quantity produced and name of each factory is obtained from the database and plotted. On clicking on a pie-section, it links to another chart giving detailed information of each output produced and the date of production. For this dataURL method is used from the js. of that factory. An array is created to store the index, factory name and total output. This array is accessible to the view. Also, a js_var_string variable is constructed. This variable contains javascript code to create an array, to contain the date of production and the factory output quantity.