Sign in to follow this  
denisagui

(Solved) How To Create Javascript Chart In Jsf 2.0

Recommended Posts

Hello, I have created charts using flash being, however there is a need to use javascript because my application is aimed at smart TVs that do not have flash support. the syntax I use to generate flash is as follows.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:fc="http://www.fusioncharts.com">

<h:head>

</h:head>

<h:body>
	<fc:render chartId="LineAproNeg3D" filename="../FusionCharts/MSLine.swf"
	width="100%" height="100%" debugMode="false" registerWithJS="1"
	WMode="0" color="CCCCCC" scaleMode="0" lang="en"
	detectFlashVersion="0" autoInstallRedirect=""
	xml="#{lineMB.stringXml}" />

</h:body>
</html>

 

 

 

I would like to know how to generate graphics on javascript if possible and creates them using the same syntax or is necessary to create a specific file for the same.

Edited by denisagui

Share this post


Link to post
Share on other sites

SOLVED!

 

<fc:render chartId="${chartData.chartId}" swfFilename="${folderPath}${chartData.swfFilename}"

width="${chartData.width}" height="${chartData.height}" debugMode="false"

registerWithJS="true" xmlUrl="${chartData.url}" renderer="javascript"/>

Share this post


Link to post
Share on other sites

:)

 

 

I have problem wmode on Firefox, does not work and overwrites the menu

 

 

 

 

<fc:render chartId="SimpleChart"

filename="#{application.contextPath}/pages/geral/FusionCharts/FCF_Column2D.swf"

width="600" height="300" debugMode="false" registerWithJS="false"

xml="#{mBeanEstatisticas.gerarChartDepartamento()}" renderer="javascript" WMode="0">

 

</fc:render>

 

 

 

 

Share this post


Link to post
Share on other sites

Hi Faraiz,

The attribute which FusionCharts uses is "windowMode" (not WMode) which can be set to window/opaque/transparent.

window - This is the default mode.The chart or Flash Player acts as a separate window, always lying above the HTML elements. So the HTML elements, like the HTML menu, lie below the charts.

opaque - In this mode the charts are integrated to the HTML elements, unlike the Window mode. Here, the DHTML elements can come over the chart.

transparent - Similar to the Opaque mode, however, in this mode, the chart background can be changed to transparent or translucent (modifying the value of the bgAlpha attribute accordingly) so that the color or the HTML elements below the chart (which are part of HTML and not chart) are visible.

Eg. <fc:render .... windowMode='opaque' ....>

For more information, please follow the documentation link : http://docs.fusionch...sicExample.html

Hope this helps.

Edited by Haritha

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
Sign in to follow this