Module FusionChartsHelper
In: lib/fusioncharts_helper.rb

Methods

Public Instance methods

This function can be used when time needs to be added to the URL This will help avoiding cache of the page rendered by the URL Can be used for dataURL method

get_FC_color function helps return a color from arr_FCColors array. It uses cyclic iteration to return a color from a given index. The index value is maintained in FC_ColorCounter

This function returns the BOM for UTF8. BOM needs to be placed as first few bytes in the xml before providing to the chart. This can be used in the XML provider views.

Renders a chart from the swf file passed as parameter either making use of setDataURL method or setDataXML method. The width and height of chart are passed as parameters to this function. If the chart is not rendered, the errors can be detected by setting debugging mode to true while calling this function. This feature is not available in free version. The view file can be registered to include javascript statements by setting registering with javascript to true while calling this function.

  • parameter chart_swf : pass swf file that renders the chart.
  • parameter str_url : URL path to the xml file.
  • parameter str_xml : XML content.
  • parameter chart_id : Id for the chart, using which it will be identified in the page. Each chart on the page needs to have a unique Id. Datatype: String
  • parameter chart_width : Integer for the width of the chart in pixels.
  • parameter chart_height : Integer for the height of the chart in pixels.
  • parameter debug_mode : (Not used in Free version) If value is true, chart is shown in debug mode.
  • parameter register_with_js : (Not used in Free version) If value is true, the chart is registered with javascript

Can be called from html block int he view where the chart needs to be embedded.

Uses render_component. Renders a chart using the swf file passed as parameter by calling an action to get the xml for the setDataXML method. The width and height of chart are passed as parameters to this function. If the chart is not rendered, the errors can be detected by setting debugging mode to true while calling this function.

  • parameter chart_swf : SWF file that renders the chart.
  • parameter controller_name : The complete name of the controller containing the action.
  • parameter action_name : The name of the action which will provide the xml.
  • parameter chart_id : String for identifying chart.
  • parameter chart_width : Integer for the width of the chart.
  • parameter chart_height : Integer for the height of the chart.
  • parameter debug_mode : (Not used in Free version) If value is true, chart is shown in debug mode.
  • parameter register_with_js : (Not used in Free version) If value is true, the chart is registered with javascript

Can be called from html block in the view where the chart needs to be embedded.

Renders a chart from the swf file passed as parameter either making use of setDataURL method or setDataXML method. The width and height of chart are passed as parameters to this function. If the chart is not rendered, the errors can be detected by setting debugging mode to true while calling this function.

  • parameter chart_swf : SWF file that renders the chart.
  • parameter str_url : URL path to the xml file.
  • parameter str_xml : XML content.
  • parameter chart_id : String for identifying chart.
  • parameter chart_width : Integer for the width of the chart.
  • parameter chart_height : Integer for the height of the chart.
  • parameter debug_mode : (Not used in Free version)True ( a boolean ) for debugging errors, if any, while rendering the chart.

Can be called from html block in the view where the chart needs to be embedded.

[Validate]