|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.fusioncharts.FusionChartsHelper
public class FusionChartsHelper
Contains methods to add no cache string to a url,getting colors for the
charts.
This class can be used to create chart xml given the swf filename and other
parameters.
In order to use this class in your jsps,import this class and
call the appropriate method directly as follows:
FusionChartsHelper.addCacheToDataURL(...);
In order to use this class for colors call the method as shown:
FusionChartsHelper helper = new FusionChartsHelper();
String bgColor = helper.getFCColor();
Field Summary | |
---|---|
(package private) java.lang.String[] |
arr_FCColors
|
(package private) int |
FC_ColorCounter
|
protected java.lang.String |
UTFBOMString
|
Constructor Summary | |
---|---|
FusionChartsHelper()
|
Method Summary | |
---|---|
static java.lang.String |
addCacheToDataURL(java.lang.String strDataURL)
Adds additional string to the url to and encodes the parameters, so as to disable caching of data. |
static int |
boolToNum(java.lang.Boolean bool)
Converts a Boolean value to int value |
static java.lang.String |
createChart(java.lang.String chartSWF,
java.lang.String strURL,
java.lang.String strXML,
java.lang.String chartId,
int chartWidth,
int chartHeight,
boolean debugMode,
boolean registerWithJS)
Deprecated. |
static java.lang.String |
createChart(java.lang.String chartSWF,
java.lang.String strURL,
java.lang.String strData,
java.lang.String dataFormat,
java.lang.String chartId,
java.lang.String chartWidth,
java.lang.String chartHeight,
boolean debugMode,
boolean registerWithJS)
New method to handle all data formats supported by FusionCharts JS API version >= 3.2. |
static java.lang.String |
createChart(java.lang.String chartSWF,
java.lang.String strURL,
java.lang.String strData,
java.lang.String dataFormat,
java.lang.String chartId,
java.lang.String chartWidth,
java.lang.String chartHeight,
boolean debugMode,
boolean registerWithJS,
java.lang.String bgColor,
java.lang.String scaleMode,
java.lang.String lang,
java.lang.String detectFlashVersion,
java.lang.String autoInstallRedirect,
java.lang.String windowMode)
New method to handle 1. |
static java.lang.String |
createChartHTML(java.lang.String chartSWF,
java.lang.String strURL,
java.lang.String strXML,
java.lang.String chartId,
java.lang.String chartWidth,
java.lang.String chartHeight,
boolean debugMode)
Creates the object tag required to embed a chart. |
static java.lang.String |
createChartHTML(java.lang.String chartSWF,
java.lang.String strURL,
java.lang.String strXML,
java.lang.String chartId,
java.lang.String chartWidth,
java.lang.String chartHeight,
boolean debugMode,
java.lang.String bgColor,
java.lang.String scaleMode,
java.lang.String lang,
java.lang.String windowMode)
Handles all the parameters including bgColor, scaleMode, lang and wmode Creates the object tag required to embed a chart. |
static java.lang.String |
createChartWithJSON(java.lang.String chartSWF,
java.lang.String strURL,
java.lang.String strData,
java.lang.String chartId,
java.lang.String chartWidth,
java.lang.String chartHeight,
boolean debugMode,
boolean registerWithJS)
|
static java.lang.String |
createChartWithJSON(java.lang.String chartSWF,
java.lang.String strURL,
java.lang.String strData,
java.lang.String chartId,
java.lang.String chartWidth,
java.lang.String chartHeight,
boolean debugMode,
boolean registerWithJS,
java.lang.String bgColor,
java.lang.String scaleMode,
java.lang.String lang,
java.lang.String detectFlashVersion,
java.lang.String autoInstallRedirect,
java.lang.String windowMode)
|
static java.lang.String |
createChartWithXML(java.lang.String chartSWF,
java.lang.String strURL,
java.lang.String strData,
java.lang.String chartId,
java.lang.String chartWidth,
java.lang.String chartHeight,
boolean debugMode,
boolean registerWithJS)
|
static java.lang.String |
createChartWithXML(java.lang.String chartSWF,
java.lang.String strURL,
java.lang.String strData,
java.lang.String chartId,
java.lang.String chartWidth,
java.lang.String chartHeight,
boolean debugMode,
boolean registerWithJS,
java.lang.String bgColor,
java.lang.String scaleMode,
java.lang.String lang,
java.lang.String detectFlashVersion,
java.lang.String autoInstallRedirect,
java.lang.String windowMode)
|
static java.lang.String |
encodeDataURL(java.lang.String strDataURL,
boolean addNoCacheStr)
Encodes the dataURL before it's served to FusionCharts. |
java.lang.String |
getFCColor()
Returns a color from the array. |
static java.lang.String |
obtainUTFBOMAsString()
Returns UTF8 BOM as a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
int FC_ColorCounter
protected java.lang.String UTFBOMString
java.lang.String[] arr_FCColors
Constructor Detail |
---|
public FusionChartsHelper()
Method Detail |
---|
public static java.lang.String addCacheToDataURL(java.lang.String strDataURL)
strDataURL
- - dataURL to be fed to chart
public static int boolToNum(java.lang.Boolean bool)
bool
- Boolean value which needs to be converted to int value
@Deprecated public static java.lang.String createChart(java.lang.String chartSWF, java.lang.String strURL, java.lang.String strXML, java.lang.String chartId, int chartWidth, int chartHeight, boolean debugMode, boolean registerWithJS)
chartSWF
- - SWF File Name (and Path) of the chart which you intend to
plotstrURL
- - If you intend to use dataUrl method for this chart, pass the
URL as this parameter. Else, set it to "" (in case of dataXML
method)strXML
- - If you intend to use dataXML method for this chart, pass the
XML data as this parameter. Else, set it to "" (in case of
dataURL method)chartId
- - Id for the chart, using which it will be recognized in the
HTML page. Each chart on the page needs to have a unique Id.chartWidth
- - Intended width for the chart (in pixels)chartHeight
- - Intended height for the chart (in pixels)debugMode
- - Whether to start the chart in debug moderegisterWithJS
- - Whether to ask chart to register itself with JavaScript
public static java.lang.String createChart(java.lang.String chartSWF, java.lang.String strURL, java.lang.String strData, java.lang.String dataFormat, java.lang.String chartId, java.lang.String chartWidth, java.lang.String chartHeight, boolean debugMode, boolean registerWithJS)
chartSWF
- - SWF File Name (and Path) of the chart which you intend to
plotstrURL
- - If you intend to use dataURL method for this chart, pass the
Url as this parameter. Else, set it to "" (in case of
dataString method)strData
- - If you intend to use dataString method for this chart, pass
the XML/JSON data as this parameter. Else, set it to "" (in
case of dataUrl method)dataFormat
- - Format of the data provided.chartId
- - Id for the chart, using which it will be recognized in the
HTML page. Each chart on the page needs to have a unique Id.chartWidth
- - Intended width for the chart (in pixels)chartHeight
- - Intended height for the chart (in pixels)debugMode
- - Whether to start the chart in debug moderegisterWithJS
- - Whether to ask chart to register itself with JavaScript
public static java.lang.String createChart(java.lang.String chartSWF, java.lang.String strURL, java.lang.String strData, java.lang.String dataFormat, java.lang.String chartId, java.lang.String chartWidth, java.lang.String chartHeight, boolean debugMode, boolean registerWithJS, java.lang.String bgColor, java.lang.String scaleMode, java.lang.String lang, java.lang.String detectFlashVersion, java.lang.String autoInstallRedirect, java.lang.String windowMode)
chartSWF
- - SWF File Name (and Path) of the chart which you intend to
plotstrURL
- - If you intend to use dataUrl method for this chart, pass the
Url as value for this parameter. Else, set it to "" (in case
of dataString method)strData
- dataFormat
- chartId
- - Id for the chart, using which it will be recognized in the
HTML page. Each chart on the page needs to have a unique Id.chartWidth
- - Intended width for the chart (in pixels)chartHeight
- - Intended height for the chart (in pixels)debugMode
- - Whether to start the chart in debug moderegisterWithJS
- - Whether to ask chart to register itself with JavaScriptbgColor
- - Background color of the Flash movie (here chart) which comes
below the chart and is visible if chart's background color is
set to transparent or translucent using bgAlpha.scaleMode
- - "noScale" - recommended/default, "exactFit" - scales the
chart to fit the container exactly with width and height
(causes distortion in some cases), "noBorder" - constrained
scale. (not recommended at all), "showAll" - (not recommended)lang
- - Language, as of now its only value is "EN" for englishdetectFlashVersion
- - Checks the Flash Player version and if version is less than
8 and autoInstallRedirect is set on then asks the user to
install Flash Player from Adobe siteautoInstallRedirect
- - If set on, the user would be redirected to Adobe site if
Flash player 8 is not installed.wMode
- - Can accept values: "window"/"opaque"/ "transparent".
public static java.lang.String createChartHTML(java.lang.String chartSWF, java.lang.String strURL, java.lang.String strXML, java.lang.String chartId, java.lang.String chartWidth, java.lang.String chartHeight, boolean debugMode)
chartSWF
- - SWF File Name (and Path) of the chart which you intend to
plotstrURL
- - If you intend to use dataUrl method for this chart, pass the
URL as this parameter. Else, set it to "" (in case of
dataString method)strXML
- - If you intend to use dataXML method for this chart, pass the
XML data as this parameter. Else, set it to "" (in case of
dataURL method)chartId
- - Id for the chart, using which it will be recognized in the
HTML page. Each chart on the page needs to have a unique Id.chartWidth
- - Intended width for the chart (in pixels)chartHeight
- - Intended height for the chart (in pixels)debugMode
- - Whether to start the chart in debug mode
public static java.lang.String createChartHTML(java.lang.String chartSWF, java.lang.String strURL, java.lang.String strXML, java.lang.String chartId, java.lang.String chartWidth, java.lang.String chartHeight, boolean debugMode, java.lang.String bgColor, java.lang.String scaleMode, java.lang.String lang, java.lang.String windowMode)
chartSWF
- - SWF File Name (and Path) of the chart which you intend to
plotstrURL
- - If you intend to use dataUrl method for this chart, pass the
Url as value for this parameter. Else, set it to "" (in case
of dataString method)strXML
- - If you intend to use dataString method for this chart, pass
the XML data as this parameter. Else, set it to "" (in case of
dataURL method)chartId
- - Id for the chart, using which it will be recognized in the
HTML page. Each chart on the page needs to have a unique Id.chartWidth
- - Intended width for the chart (in pixels)chartHeight
- - Intended height for the chart (in pixels)debugMode
- - Whether to start the chart in debug modebgColor
- - Background color of the Flash movie (here chart) which comes
below the chart and is visible if chart's background color is
set to transparent or translucent using bgAlpha.scaleMode
- - "noScale" - recommended/default, "exactFit" - scales the
chart to fit the container exactly with width and height
(causes distortion in some cases), "noBorder" - constrained
scale. (not recommended at all), "showAll" - (not recommended)lang
- - Language, as of now its only value is "EN" for englishwMode
- - Can accept values: "window"/"opaque"/ "transparent".
public static java.lang.String createChartWithJSON(java.lang.String chartSWF, java.lang.String strURL, java.lang.String strData, java.lang.String chartId, java.lang.String chartWidth, java.lang.String chartHeight, boolean debugMode, boolean registerWithJS)
chartSWF
- - SWF File Name (and Path) of the chart which you intend to
plotstrURL
- - If you intend to use dataUrl method for this chart, pass the
Url to the JSON as value for this parameter. Else, set it to
"" (in case of dataString method)strData
- - If you intend to use dataString method for this chart, pass
the JSON data as the value for this parameter. Else, set it to
"" (in case of dataUrl method)chartId
- - Id for the chart, using which it will be recognized in the
HTML page. Each chart on the page needs to have a unique Id.chartWidth
- - Intended width for the chart (in pixels)chartHeight
- - Intended height for the chart (in pixels)debugMode
- - Whether to start the chart in debug moderegisterWithJS
- - Whether to ask chart to register itself with JavaScript
public static java.lang.String createChartWithJSON(java.lang.String chartSWF, java.lang.String strURL, java.lang.String strData, java.lang.String chartId, java.lang.String chartWidth, java.lang.String chartHeight, boolean debugMode, boolean registerWithJS, java.lang.String bgColor, java.lang.String scaleMode, java.lang.String lang, java.lang.String detectFlashVersion, java.lang.String autoInstallRedirect, java.lang.String windowMode)
chartSWF
- - SWF File Name (and Path) of the chart which you intend to
plotstrURL
- - If you intend to use dataUrl method for this chart, pass the
Url as value for this parameter. Else, set it to "" (in case
of dataString method)strData
- - If you intend to use dataString method for this chart, pass
the JSON data as the value for this parameter. Else, set it to
"" (in case of dataUrl method)chartId
- - Id for the chart, using which it will be recognized in the
HTML page. Each chart on the page needs to have a unique Id.chartWidth
- - Intended width for the chart (in pixels)chartHeight
- - Intended height for the chart (in pixels)debugMode
- - Whether to start the chart in debug moderegisterWithJS
- - Whether to ask chart to register itself with JavaScriptbgColor
- - Background color of the Flash movie (here chart) which comes
below the chart and is visible if chart's background color is
set to transparent or translucent using bgAlpha.scaleMode
- - "noScale" - recommended/default, "exactFit" - scales the
chart to fit the container exactly with width and height
(causes distortion in some cases), "noBorder" - constrained
scale. (not recommended at all), "showAll" - (not recommended)lang
- - Language, as of now its only value is "EN" for englishdetectFlashVersion
- - Checks the Flash Player version and if version is less than
8 and autoInstallRedirect is set on then asks the user to
install Flash Player from Adobe siteautoInstallRedirect
- - If set on, the user would be redirected to Adobe site if
Flash player 8 is not installed.windowMode
- - Can accept values: "window"/"opaque"/ "transparent".
public static java.lang.String createChartWithXML(java.lang.String chartSWF, java.lang.String strURL, java.lang.String strData, java.lang.String chartId, java.lang.String chartWidth, java.lang.String chartHeight, boolean debugMode, boolean registerWithJS)
chartSWF
- - SWF File Name (and Path) of the chart which you intend to
plotstrURL
- - If you intend to use dataUrl method for this chart, pass the
Url as value for this parameter. Else, set it to "" (in case
of dataString method)strData
- - If you intend to use dataUrl method for this chart, pass the
Url to the JSON as value for this parameter. Else, set it to
"" (in case of dataString method)chartId
- - Id for the chart, using which it will be recognized in the
HTML page. Each chart on the page needs to have a unique Id.chartWidth
- - Intended width for the chart (in pixels)chartHeight
- - Intended height for the chart (in pixels)debugMode
- - Whether to start the chart in debug moderegisterWithJS
- - Whether to ask chart to register itself with JavaScript
public static java.lang.String createChartWithXML(java.lang.String chartSWF, java.lang.String strURL, java.lang.String strData, java.lang.String chartId, java.lang.String chartWidth, java.lang.String chartHeight, boolean debugMode, boolean registerWithJS, java.lang.String bgColor, java.lang.String scaleMode, java.lang.String lang, java.lang.String detectFlashVersion, java.lang.String autoInstallRedirect, java.lang.String windowMode)
chartSWF
- - SWF File Name (and Path) of the chart which you intend to
plotstrURL
- - If you intend to use dataUrl method for this chart, pass the
Url as value for this parameter. Else, set it to "" (in case
of dataString method)strData
- - If you intend to use dataString method for this chart, pass
the XML data as the value for this parameter. Else, set it to
"" (in case of dataUrl method)chartId
- - Id for the chart, using which it will be recognized in the
HTML page. Each chart on the page needs to have a unique Id.chartWidth
- - Intended width for the chart (in pixels)chartHeight
- - Intended height for the chart (in pixels)debugMode
- - Whether to start the chart in debug moderegisterWithJS
- - Whether to ask chart to register itself with JavaScriptbgColor
- - Background color of the Flash movie (here chart) which comes
below the chart and is visible if chart's background color is
set to transparent or translucent using bgAlpha.scaleMode
- - "noScale" - recommended/default, "exactFit" - scales the
chart to fit the container exactly with width and height
(causes distortion in some cases), "noBorder" - constrained
scale. (not recommended at all), "showAll" - (not recommended)lang
- - Language, as of now its only value is "EN" for englishdetectFlashVersion
- - Checks the Flash Player version and if version is less than
8 and autoInstallRedirect is set on then asks the user to
install Flash Player from Adobe siteautoInstallRedirect
- - If set on, the user would be redirected to Adobe site if
Flash player 8 is not installed.windowMode
- - Can accept values: "window"/"opaque"/ "transparent".
public static java.lang.String encodeDataURL(java.lang.String strDataURL, boolean addNoCacheStr)
strDataURL
- - dataURL to be fed to chartaddNoCacheStr
- - Whether to add additional string to URL to disable caching
of data
public static java.lang.String obtainUTFBOMAsString()
public java.lang.String getFCColor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |