【问题标题】:GWT Visualization AnnotatedTimeLine graph giving exception Container height is zeroGWT Visualization AnnotatedTimeLine 图给出异常容器高度为零
【发布时间】:2011-04-23 12:15:04
【问题描述】:

我正在尝试使用 GWT 可视化中提供的 AnnotatedTimeLine 图,但出现以下异常

com.google.gwt.core.client.JavaScriptException:(错误):容器高度为零。期望一个有效的高度。 堆栈:错误:容器高度为零。期望一个有效的高度。

我的视图类代码如下

void onButtonLineGraphClick(ClickEvent 事件) { 可运行 onLoadCallback1 = new Runnable() { 公共无效运行(){ AnnotatedTimeLine 时间线 = new AnnotatedTimeLine(createLineTable(), createOptionsLine(), “200”、“200”); panelGraph.setHeight("200"); panelGraph.setWidth("200"); panelGraph.add(时间线); } }; VisualizationUtils.loadVisualizationApi(onLoadCallback1, AnnotatedTimeLine.PACKAGE); }

并且 Pannel Graph 在 ui.xml 中定义如下

g:HTMLPanel width = "200px" height="200px" ui:field="panelGraph"

【问题讨论】:

    标签: gwt google-visualization


    【解决方案1】:

    AnnotatedTimeLine 时间线 = new AnnotatedTimeLine(createLineTable(), createOptionsLine(), "200", "200");

    应该替换为

    AnnotatedTimeLine 时间线 = new AnnotatedTimeLine(createLineTable(), createOptionsLine(), "200px", "200px");

    终于明白了……

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-15
      • 1970-01-01
      • 2020-07-25
      • 1970-01-01
      • 1970-01-01
      • 2013-01-09
      • 2014-02-19
      • 2013-04-08
      相关资源
      最近更新 更多