Chart not rendering

UI Components for JSF
jean.baldessar
Posts: 10
Joined: 13 Oct 2009, 16:23

13 Oct 2009, 16:30

I read about here http://primefaces.prime.com.tr/forum/vi ... 15&start=0
but the problem seems to be a little diferent.

I can se the editor to, but the chart is not rendering...


here is my xhtml:

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p	 = "http://primefaces.prime.com.tr/ui" >
	
<head>
	<p:resources /> 
</head>
<body>
	
	<h:form>
		<p:pieChart value="#{pwkf022.pieChartList}" var="sale" categoryField=" #{sale.nome}"  
	    	dataField="#{sale.numero}" styleClass="pie" style="chartStyle" />  
	</h:form>
</body>
</html>
here is the generated html:

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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">
	
<head>
<link class="component" href="/a4j/s/3_3_1.GAorg/richfaces/renderkit/html/css/basic_both.xcss/DATB/eAFzVXyyNnT5DGkAEGQDpw__.prj" rel="stylesheet" type="text/css" /><link class="component" href="/a4j/s/3_3_1.GAorg/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAFzVXyyNnT5DGkAEGQDpw__.prj" media="rich-extended-skinning" rel="stylesheet" type="text/css" /><script type="text/javascript">window.RICH_FACES_EXTENDED_SKINNING_ON=true;</script><script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/skinning.js.prj" type="text/javascript"></script><script type="text/javascript" src="/primefaces_resources/0.9.3/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="/primefaces_resources/0.9.3/primefaces/core/core.js"></script>
<script type="text/javascript" src="/primefaces_resources/0.9.3/yui/datasource/datasource-min.js"></script>
<script type="text/javascript" src="/primefaces_resources/0.9.3/yui/json/json-min.js"></script>
<script type="text/javascript" src="/primefaces_resources/0.9.3/yui/swf/swf-min.js"></script>

<script type="text/javascript" src="/primefaces_resources/0.9.3/yui/charts/charts-min.js"></script>
<script type="text/javascript" src="/primefaces_resources/0.9.3/jquery/jquery.js"></script>
<script type="text/javascript" src="/primefaces_resources/0.9.3/primefaces/ajax/ajax.js"></script>
<script type="text/javascript" src="/primefaces_resources/0.9.3/primefaces/charts/charts.js"></script>

 
</head>
<body>
<form id="j_id4" name="j_id4" method="post" action="/teste.prj" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_id4" value="j_id4" />
<script type="text/javascript">YAHOO.widget.Chart.SWFURL = "/primefaces_resources/0.9.3/yui/charts/assets/charts.swf"</script><script type="text/javascript">PrimeFaces.core.Utils.onContentReady("j_id4:j_id5", function() {
var j_id4_j_id5_widget_data = [{nome:' Uma Coisa',numero:123},
{nome:' asd',numero:652},
{nome:' AQa',numero:248}];
var j_id4_j_id5_widget_dataSource = new YAHOO.util.DataSource(j_id4_j_id5_widget_data);
j_id4_j_id5_widget_dataSource.responseType=YAHOO.util.DataSource.TYPE_JSARRAY;
j_id4_j_id5_widget_dataSource.responseSchema = {fields:["nome","numero"]};
j_id4_j_id5_widget = new YAHOO.widget.PieChart("j_id4:j_id5", j_id4_j_id5_widget_dataSource,{categoryField:"nome",dataField:"numero",expressInstall:"/primefaces_resources/0.9.3/yui/assets/expressinstall.swf",style:chartStyle});
});
</script><div id="j_id4:j_id5" class="pie"></div><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id4" />

</form>
</body>
</html>

why?

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

13 Oct 2009, 16:41

Hi,

can you see a problem in the browser or in the console?

btw can you see these charts: http://97.107.138.40:8080/prime-showcas ... eChart.jsf ?

Yigit

jean.baldessar
Posts: 10
Joined: 13 Oct 2009, 16:23

13 Oct 2009, 16:51

Yes I can see it: http://97.107.138.40:8080/prime-showcas ... eChart.jsf

The problam is that the browser dont show my chart. :/

Could it be a dependency problem?
My application has been deployed with no error messages.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 Oct 2009, 17:54

What is the browser you're testing with?

jean.baldessar
Posts: 10
Joined: 13 Oct 2009, 16:23

13 Oct 2009, 18:40

Mozilla Firefox 3.5

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 Oct 2009, 21:23

Can you try adding the following to your f:view tag;

Code: Select all

<f:view contentType="text/html">
</f:view>

jean.baldessar
Posts: 10
Joined: 13 Oct 2009, 16:23

16 Oct 2009, 15:44

I found the problem... My application need to run in a offline environment (a local network) and the chart component uses a Yahoo resource or something like that.

is ther a way to use local resources??

thanks

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

16 Oct 2009, 15:53

yahoo resource? I'm not aware of an external resource. Which resource are you referring to Jean? Thanks.

jean.baldessar
Posts: 10
Joined: 13 Oct 2009, 16:23

16 Oct 2009, 16:07

sorry... it's not that. It works in Internet Explorer. :\

Now I'm confused

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

16 Oct 2009, 16:12

Weird, it's usually the ie that fails now firefox. So does it work in firefox as well?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests