Path: | app/controllers/fusioncharts/db_js_dataurl_controller.rb |
Last Update: | Tue Mar 10 11:49:54 +0530 2009 |
This example shows how to generate a pie-chart by retrieving values of the total output quantities produced in factories with their names On clicking on a pie-section, the detailed date-wise output quantity for that factory is displayed as a chart on the same page. In this example, we show a combination of database + JavaScript (dataURL method) rendering using FusionCharts. The entire example can be summarized as under. This example shows the break-down of factory wise output generated. In a pie chart, we first show the sum of quantity generated by each factory. These pie slices, when clicked would show detailed date-wise output of that factory. The detailed data would be dynamically pulled by the column chart from another page. There are no page refreshes required. Everything is done on one single page. The XML data for the pie chart is fully created at run-time. Now, for the column chart (date-wise output report), each time we need the data we dynamically submit request to the server with the appropriate factoryId. The server responds with an XML document, which we accept and update chart at client side.