Gwt gchart没有出现

Gwt gchart没有出现,gwt,gchart,Gwt,Gchart,我使用的是来自GChart的这个简单示例 public void displayGChart(final ArrayList<ResultDTO> result){ GChart c = new GChart(); c.setChartTitle("<b>x<sup>2</sup> vs x</b>"); c. setChartSize(150, 150);

我使用的是来自GChart的这个简单示例

      public void displayGChart(final ArrayList<ResultDTO> result){

        GChart c = new GChart();
        c.setChartTitle("<b>x<sup>2</sup> vs x</b>");
        c. setChartSize(150, 150);
        c. addCurve();
         for (int i = 0; i < 10; i++) 
             c.  getCurve().addPoint(i,i*i);
         c.getCurve().setLegendLabel("x<sup>2</sup>");
         c. getXAxis().setAxisLabel("x");
         c. getYAxis().setAxisLabel("x<sup>2</sup>");


    verticalPanel.add(c);
    verticalPanel.add(new Label("test"));
}
public void displayGChart(最终ArrayList结果){
GChart c=新的GChart();
c、 setChartTitle(“x2 vs x”);
c、 设置图表大小(150150);
c、 添加曲线();
对于(int i=0;i<10;i++)
c、 getCurve().addPoint(i,i*i);
c、 getCurve().setLegendLabel(“x2”);
c、 getXAxis().setAxisLabel(“x”);
c、 getYAxis().setAxisLabel(“x2”);
垂直面板。添加(c);
添加(新标签(“测试”));
}
当我运行应用程序时,没有出现任何错误,我可以在浏览器上看到此“测试”,但没有其他内容,没有显示任何图表

我已经把罐子加上了

            <inherits name='com.googlecode.gchart.GChart' />

想知道原因是什么吗请打电话给c.update();将图表添加到面板后,如下所示:

    verticalPanel.add(c);
    c.update();
    verticalPanel.add(new Label("test"));
这里也描述了这一点:

没有图表?这些示例仅定义图表。要实际显示它,必须添加并更新它:

    // Use this typical GChart boilerplate to test out these examples:
    GChart gchart = new GChartExample00(); 
    RootPanel.get().add(gchart);
    gchart.update();