Class | Fusioncharts::DbDataUrlController
In: | app/controllers/fusioncharts/db_data_url_controller.rb
Parent: | ApplicationController

This controller class shows how to render a pie-chart by retrieving factory name and total output quantity dynamically at run-time, from the database. setDataURL method is used here. As per Ruby On Rails conventions, we have the corresponding views with the same name as the function name in the controller.

### Methods

default pie_data

### Public Instance methods

default()

NOTE: It‘s necessary to encode the dataURL if you‘ve added parameters to it. In this example, we show how to connect FusionCharts to a database using dataURL method. In our other examples, we‘ve used dataXML method where the XML is generated in the same page as chart. Here, the XML data for the chart would be generated in pie_data function. pie_data action would handle the request and then generate the XML accordingly.

pie_data()

Generates the xml with each factory‘s name and total output quantity. Content-type for its view is text/xml

[Validate]