2010-08-30 2 views
0

J'utilise Eclipse avec GAE sur un MacBook Pro avec GChart. Mon problème est que je n'arrive pas à montrer un tableau quand je le développe, mais quand j'utilise des outils standards tels que des boutons ou des étiquettes avec GAE, ils fonctionnent très bien. Le code ne je suppose que je me donne pas d'erreurs, de sorte que le bon code:
GChart sur GAE ne montrera pas


public class TestingTesting implements EntryPoint { 
    public void onModuleLoad() { 
     GChart graf = new GChart(); 
     graf.setTitle("testing"); 
     graf.setChartSize(200, 200); 
     graf.addCurve(); 
     graf.getCurve().getSymbol().setFillThickness(2); 
     for (int i = 0; i < 10; i++) 
      graf.getCurve().addPoint(i,i*i); 
     Button btnOk = new Button("Ok"); 
     RootPanel.get("chartdiv").add(graf); 
     RootPanel.get("button").add(btnOk); 
    } 
} 

et mon fichier TestingTesting.gwt.xml ressemble à ceci:

 

<?xml version="1.0" encoding="UTF-8"?> 
<module rename-to='testingtesting'> 
    <!-- Inherit the core Web Toolkit stuff. --> 
    <inherits name='com.google.gwt.user.User' /> 
    <!-- Inherit the default GWT style sheet. You can change --> 
    <!-- the theme of your GWT application by uncommenting --> 
    <!-- any one of the following lines. --> 
    <inherits name='com.google.gwt.user.theme.standard.Standard' /> 
    <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> --> 
    <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> --> 
    <!-- Other module inherits --> 
    <inherits name='com.googlecode.gchart.GChart' /> 
    <!-- Specify the app entry point class. --> 
    <entry-point class='test.gchart.sollution.client.TestingTesting' /> 
    <!-- Specify the paths for translatable code --> 
    <source path='client' /> 
    <source path='shared' /> 
</module> 
 

Mon TestingTesting.html ressemble à ceci:


<html> 
<head> 
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> 


<title>Chart Example</title> 
<script type="text/javascript" language="javascript" 
    src="testingtesting/testingtesting.nocache.js"></script> 
</head> 

<body> 
    <div id="chartdiv"></div> 
    <div id="button"></div> 
</body> 
</html> 

autre que cela, ma structure du projet dans Eclipse est

 
/
- gchart.jar 
- App Engine SDK [App Engine 1.3.5] 
- GWT SDK [GWT - 2.0.4] 
- JRE System Library 
- src 
-- test.gchart.sollution 
--- TestingTesting.gwt.xml 
-- test.gchart.sollution.client 
--- TestingTesting.java 
-- test.gchart.sollution.server 
-- test.gchart.sollution.shared 
--- FieldVerifier.java 
- META-INF 
-- jdoconfig.xml 
- log4j.properties 
- war 
-- TestTest.html 
- WEB-INF 
-- appengine-web.xml 
-- logging.properties 
-- web.xml 

Quelqu'un peut-il m'aider à comprendre quel pourrait être le problème? Le bouton affiche sans problème, mais le graphique ne le fait pas?

+0

pourrait être utile d'inclure un lien vers la bibliothèque que vous utilisez: http://code.google.com/p/clientsidegchart - Peut être aussi être utile de demander aux développeurs de cette bibliothèque, qui peuvent avoir une meilleure compréhension de ce qui ne va pas. –

Répondre

0

J'ai réalisé ce que j'ai mal fait.
j'ai oublié le TestingTesting.java d'inclure

RootPanel.get("chartdiv").add(graf); 
graf.update();  // you have to update your graph before it renders 
Questions connexes