FusionCharts Support

Fusion Charts intergration with JSF Data XML Hard-coded

Recommended Posts

Hi

 

Can we use fusion chart with XML data hard-coded ?

 

I used it in a portlet seam + jsf + facelets + richfaces environment.

 

 

 

I have following code in index.xhtml attachments

 

 

 

 

 

And i have the following result source code HTML attachments

 

 

 

 

 

The "dataURL" is null ...

 

 

 

I removed all indentation and formatting

 

But doesn't work

 

 

 

 

 

 

 

By syllepsa > @mathai I noticed that you didn't include java script code.

 

 

 

Yes, you're right, but i used a template and i included java script code in template.xhtml

index.txt

result_html.txt

template.txt

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

From your source i find a place having:

<param name="quality" value="high" />

 <graph caption=

This should be:

<param name="quality" value="high" />

<param name="flashvars" value="dataXML=<graph caption=.....&chartWidth=...&chartHeight=...&DOMId=..." >

 

The same FlashVars definitions also goes to the <embed> element attribute too:

flashVars="dataXML=<graph caption=.....&chartWidth=...&chartHeight=...&DOMId=..."  

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

 

In the example : Simple Column 3D Chart with XML data hard-coded in jsp page (dataXML method)

 

The code source HTML is :

 

< object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="700" height="300" name="BasicChart" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">

 

< param name="allowScriptAccess" value="always" />

 

< param name="movie" value="FusionCharts/FCF_Column3D.swf" />

 

< param name="quality" value="high" />

 

 

 

< graph caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' decimalPrecision='0' formatNumberScale='0'>

 

< set name='Jan' value='462' color='AFD8F8' />

 

< set name='Feb' value='857' color='F6BD0F' />

 

[...]

 

< set name='Dec' value='950' color='A186BE' />

 

< /graph>

 

< param name="FlashVars" value="&chartWidth=700&chartHeight=300&dataXML=<graph caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' decimalPrecision='0' formatNumberScale='0'><set name='Jan' value='462' color='AFD8F8' /><set name='Feb' value='857' color='F6BD0F' /><set name='Nov' value='761' color='9D080D' /><set name='Dec' value='950' color='A186BE' /></graph>" />

 

 

 

< embed src="FusionCharts/FCF_Column3D.swf" FlashVars="&chartWidth=700&chartHeight=300&dataXML=<graph caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' decimalPrecision='0' formatNumberScale='0'><set name='Jan' value='462' color='AFD8F8' /><set name='Feb' value='857' color='F6BD0F' /><set name='Nov' value='761' color='9D080D' /><set name='Dec' value='950' color='A186BE' /></graph>" src="FusionCharts/FCF_Column3D.swf" quality="high" width="700" height="300" name="BasicChart" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">

 

< /embed>

 

 

 

< /object>

 

 

 

So the code source HTML like my code source HTML right? =/

 

But my code doesn't find the code xml...

 

 

 

I try to replace my dynamics repeat code a4j with a hard-coded xml, I have the following code :

 

< rich:panel header="Fusion Chart">

 

< fc:renderHTML chartId="SimpleChart" filename="../FusionCharts/FCF_Column3D.swf" width="700" height="300">

 

< graph caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' decimalPrecision='0' formatNumberScale='0'>

 

< set name='Jan' value='462' color='AFD8F8' />

 

< set name='Feb' value='857' color='F6BD0F' />

 

< /graph>

 

< /fc:renderHTML>

 

< /rich:panel>

 

 

 

And the code source HTML doesn't change =/

 

Please check my input renderHTML tag, if I make some mistakes

Share this post


Link to post
Share on other sites

The following code works for me. ( slightly modified your code. ) Please test whether this works for you.

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> 
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> 
<%@ taglib uri="http://www.fusioncharts.com" prefix="fc" %> 
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:view>
<html>
<head>
<title>Show Custom Component</title>
<!-- YOU HAVE TO INCLUDE THIS -->
<script type="text/javascript" src="FusionCharts/FusionCharts.js">
</script>
</head>
<body>
<rich:panel header="Fusion Chart"> 
<fc:renderHTML chartId="SimpleChart" filename="../FusionCharts/FCF_Column3D.swf" width="700" height="300"><graph caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' decimalPrecision='0' formatNumberScale='0'><set name='Jan' value='462' color='AFD8F8' /> <set name='Feb' value='857' color='F6BD0F' /> </graph> </fc:renderHTML> 
</rich:panel> 
</body>
</html>
</f:view> 

Please try this code.

Just wanted to confirm that

  1. You are using Free version of FusionCharts. < graph > tag can be used only in the free version. The pro version uses < chart > tag.
  2. You are using JSF 1.2 and you are using the latest FusionCharts jar from the post: http://www.fusioncharts.com/forum/FindPost13230.aspx

post-806-128441571618_thumb.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now