Problem with Charts - It is Rendered Blank

Components, Ajax Framework, Utilities and More.
Post Reply
Posts: 9
Joined: 19 Jul 2009, 12:07

19 Jul 2009, 12:48

Hi All,
My charts are not getting rendered. It is just blank, despite trying all the solutions suggested throught the forum.

1. I use mozilla with flash installed. (i am able to see the charts in the primefaces demo using the same)
2. The chart is inside the <h:form>
3. I have my <p:resources/> included in side the <h:form>
4. There is no java script error / error in the console.
6. I am using JSF 1.2
5. Other prime faces components are rendered properly.
6. I am not including my chart within any richfaces tabs or panels.

The component has produced the following output on the page :

<script type="text/javascript">YAHOO.widget.Chart.SWFURL = "/OASIS/primefaces_resources/0.9.0/yui/charts/assets/charts.swf"</script><script type="text/javascript">YAHOO.util.Event.onContentReady("j_id_jsp_1651541360_1:j_id_jsp_1651541360_64", function() {
j_id_jsp_1651541360_1_j_id_jsp_1651541360_64_widget_data = [{year:"2004",cssr:10,tchDrop:11,tchSuccess:12},
var j_id_jsp_1651541360_1_j_id_jsp_1651541360_64_widget_dataSource = new YAHOO.util.DataSource(j_id_jsp_1651541360_1_j_id_jsp_1651541360_64_widget_data);
j_id_jsp_1651541360_1_j_id_jsp_1651541360_64_widget_dataSource.responseSchema = {fields:["year","cssr","tchDrop","tchSuccess"]};
var j_id_jsp_1651541360_1_j_id_jsp_1651541360_64_widget_seriesDef = [{displayName:"CSSR", xField:"cssr"},{displayName:"TCHDrop", xField:"tchDrop"},{displayName:"TchSuccess", xField:"tchSuccess"}];
j_id_jsp_1651541360_1_j_id_jsp_1651541360_64_widget = new YAHOO.widget.BarChart("j_id_jsp_1651541360_1:j_id_jsp_1651541360_64",j_id_jsp_1651541360_1_j_id_jsp_1651541360_64_widget_dataSource,{yField:"year",series:j_id_jsp_1651541360_1_j_id_jsp_1651541360_64_widget_seriesDef,expressInstall:"/OASIS/primefaces_resources/0.9.0/yui/assets/expressinstall.swf",style:chartStyle});

I know this has been a redundant topic. but could not hep myself. any help will be greatly appreciated.

Thanks and Regards,
Vinoth S

User avatar
Posts: 17368
Joined: 05 Jan 2009, 00:21
Location: Cybertron

21 Jul 2009, 21:56

As I understand chart is displayed but it's just blank?

Your code seems fine, I cant see what is wrong, can you try with an example from PrimeFaces demo to see if that one works? Maybe the problem is dataset related.

Posts: 9
Joined: 19 Jul 2009, 12:07

22 Jul 2009, 07:56

This wasnt a data problem.
This got solved, once i defined my style class and script variables (that i used in my chart tag)
.line {
width: 600px;
height: 400px;

and the java script variable
var charStyle={
padding:20, legend: { display:"right", spacing:10 }

I took it for granted that the <p:resources/> tag will dynamically import the required styles and scripts.
But seems that i have to include it manually. Am i right?

Btw, thanks for your kind help. :)

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests