pizichen

no data to display

Recommended Posts

Dear team:

    I use fusionchart with JSP/Servlet technology have a problem. I use jquery ajax send request,  IE8 work well, but my friends use IE9 or Firefox, when page loaded, can not display the chart, the page give a message: "no data to display".

 

    Here is the index.jsp code:

 

   $.ajax({
      type:"POST",
      url:"<%=request.getContextPath()%>/chartTime",
      success: function(responseText){
       var chart = new FusionCharts("<%=request.getContextPath()%>/jquery/Column3D.swf", "Chart2", width, height);
       chart.setDataXML(responseText);    
          chart.render("chartdiv1");
       }
  });

 

  Can you help me?  Sorry to bother so late.

 

Share this post


Link to post
Share on other sites

Hi,

 

If you are able to see the charts on IE 8 and not on IE9 or Firefox then please check if your chart is receiving any data to plot on IE 9 or Firefox. If you are using Flash charts, switch on the debug mode and check if your chart is getting any data from Ajax request to plot the data. Refer: http://docs.fusioncharts.com/charts/contents/Debug/Window.html

 

Alternatively, you may try alerting the "responseText" to check if data is being received from your response. 

 

If this does not solve your problem, send me your sample code replicating the problem for a better look into it.

Share this post


Link to post
Share on other sites

Hi,

 

If you are able to see the charts on IE 8 and not on IE9 or Firefox then please check if your chart is receiving any data to plot on IE 9 or Firefox. If you are using Flash charts, switch on the debug mode and check if your chart is getting any data from Ajax request to plot the data. Refer: http://docs.fusioncharts.com/charts/contents/Debug/Window.html

 

Alternatively, you may try alerting the "responseText" to check if data is being received from your response. 

 

If this does not solve your problem, send me your sample code replicating the problem for a better look into it.

 

Thank you for Haritha. I try alert the "responseText", it's a correct  xml format data.

Now, I try another method, It's works well,  I feel so confuse!

 

The modified code:

 

var chart = new FusionCharts("<%=request.getContextPath()%>/jquery/Column3D.swf", "Chart1", width, height, "0", "0");

chart.setDataURL("<%=request.getContextPath()%>/chartTime");

chart.render("chartdiv1");

Share this post


Link to post
Share on other sites

Hi,

 

It seems that the URL "<%=request.getContextPath()%>/chartTime" contains the XML data.  In your new code you have used "setDataURL" which sets the XML data of the chart to a specified URL. Now the data is retrieved from this URL and is used to render the chart.

 

In your previous code, you had used "setDataXML" which sets the data of the chart to the specified XML string. You tried to retrieve the XML from the URL using your own code and then tried setting the retrieved XML data to the setDataXML function. Possibly, responseText gave you the XML data in which might not be in the XML format. Sometimes, when you retrieve data using AJAX, the page returned is in the form of HTML code which contains XML code in the middle. FusionCharts does not accept such format since it takes pure XML data and not HTML data.

 

Also, if you not using a very old version of FusionCharts, then make use of functions "setXMLUrl" and "setXMLData". The "setDataURL" and "setDataXML" are deprecated functions.

 

Hope I am able to clarify myself. :) 

Share this post


Link to post
Share on other sites

Im building an education game that switches words on different levels and I need a way to display the words that are in a data grid. I couldnt really find the exact command that allows you to display a cell. Anyone have a solution?

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