gslender / ofcgwt

Automatically exported from code.google.com/p/ofcgwt
0 stars 0 forks source link

How to change data-files to set data by GWT? The "chartWidget.setChartData(charData);" doesn't work. #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using the chartWidget.setChartData(charData);
2. The chart only show de default data-files (data-files/pie-bug-green.txt)
3. If the directory not exists, I see this (Error #2032)

What is the expected output? What do you see instead?
I expected view my chart data, but I see the defaut data-files.

What version of the product are you using? On what operating system?
GWT 1.6.4
OFCGWT uses Version 2 Ichor (20th March 2008)
JAVA 1.6
Windows XP SP3

Please provide any additional information below.

In ChartWidget.class from OFCGWT:

public void setJsonData(String json) {
    // System.out.println(json);
    this.jsonData = json;
    if (hasFlashPlayer && isSWFInjected) {
        loadJSON(swfId, jsonData);
    }
}
When debug line "if (hasFlashPlayer && isSWFInjected) {"
hasFlashPlayer = true
isSWFInjected = false

This (isSWFInjected = false) means that no execute the loadJSON() and use 
default data-files to build chart.

My code is:
      public class ChartView extends VerticalPanel{
        ChartWidget chartWidget = new ChartWidget();
        ChartData charData = new ChartData("Sales by Region");
        PieChart pie = new PieChart();
        pie.addValues(10, 30, 40, 20);
        charData.addElements(pie);
        chartWidget.setChartData(charData);
        chartWidget.setSize("600", "600");
            this.add(chartWidget);
            this.setVisible(true);
      }

What do I do to fix it?

Original issue reported on code.google.com by coutogo...@gmail.com on 19 May 2009 at 12:22

GoogleCodeExporter commented 9 years ago
please post complete example showing the bug

Original comment by gslen...@gmail.com on 11 Jun 2009 at 9:03

GoogleCodeExporter commented 9 years ago
This problem only occurs in Internet Explorer. (Firefox and Chrome OK)

Attach Printscren.

Original comment by coutogo...@gmail.com on 23 Jun 2009 at 12:27

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

I encountered this issue as well. In my case it occurs when when I add the 
chart to a
'com.gwtext.client.widgets.Panel'. If I add the chart to a plain core-GWT Panel 
(e.g.
'com.google.gwt.user.client.ui.SimplePanel', everything looks good. 

In Hosted mode (GWT 1.7.0) the issue occurs always (Since I am using Windows, 
hosted
mode is running on IE. In that case the chart looks for 
'data-files/pie-bug-green.txt'). 

Also caching seems to play a role here. In compiled mode the issue occurs only 
the
first time when the page is loaded in IE. Once I press the refresh button the 
chart
loads correctly.

Firefox does not show this issue at all.

I will try to provide a running example by the end of the week. At this I am 
not sure
if there is an issue with your library or whether there is an issue with GwtExt.

Original comment by ghillert on 18 Nov 2009 at 5:27