com.fusioncharts
Class ChartFactory

java.lang.Object
  extended by com.fusioncharts.ChartFactory

public class ChartFactory
extends java.lang.Object

The ChartFactory class allows a chart object to be created and to associate graphs and series. It is made flexible so that we will be able to re-use this factory to build charts for multiple chart packages (ie: FusionCharts, Jfreechart) in the future. 20090325 - Implementation of methods to generate chart info for fusion charts David Lai


Constructor Summary
ChartFactory()
          Constructs a ChartFactory object.
 
Method Summary
 java.lang.String buildDOMFusionChart(java.lang.String graphName)
          Method that wraps the dataxml string so that we can use it with FusionChartsDOM.js This allows us to customize when the chart is rendered and using the DOM gives the advantage of less parameters being used
 java.lang.String buildFusionChart(java.lang.String graphName)
          Constructor for a FusionGraph object.
 Graph insertGraph(Graph graph)
          Attaches a Graph object to a Map member and returns the Graph object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartFactory

public ChartFactory()
             throws java.lang.Exception
Constructs a ChartFactory object.

Throws:
java.lang.Exception - If the application parameters could not be retrieved.
Method Detail

insertGraph

public Graph insertGraph(Graph graph)
Attaches a Graph object to a Map member and returns the Graph object

Parameters:
categories - The list of category labels.
Returns:
graph Returns the graph object that was inserted

buildFusionChart

public java.lang.String buildFusionChart(java.lang.String graphName)
                                  throws WritingException,
                                         java.lang.IllegalArgumentException
Constructor for a FusionGraph object.

Parameters:
graphName - The graph name.
Returns:
the xml string for the Fusion Chart
Throws:
WritingException - If the xml string that we are building is invalid. Ie: Unclosed Entities
java.lang.IllegalArgumentException - If the Graph Name does not exist

buildDOMFusionChart

public java.lang.String buildDOMFusionChart(java.lang.String graphName)
                                     throws WritingException,
                                            java.lang.IllegalArgumentException
Method that wraps the dataxml string so that we can use it with FusionChartsDOM.js This allows us to customize when the chart is rendered and using the DOM gives the advantage of less parameters being used

Parameters:
graphName - The name of the graph which we will wrap
Returns:
domWrapper The dataXML string wrapped in a usable tag
Throws:
WritingException - If the xml string that we are building is invalid. Ie: Unclosed Entities
java.lang.IllegalArgumentException - If the Graph Name does not exist