GWT 可视化 AnnotatedTimeLine 图给出异常容器高度为零
我正在尝试使用 GWT 可视化中提供的 AnnotatedTimeLine 图表,但出现以下异常
com.google.gwt.core.client.JavaScriptException: (Error): Container height is Zero。期望有效的高度。 堆栈:错误:容器高度为零。期望有效的高度。
我的视图类代码如下所示
void onButtonLineGraphClick(ClickEvent event) { Runnable onLoadCallback1 = new Runnable() { 公共无效运行(){ AnnotatedTimeLine 时间轴 = new AnnotatedTimeLine(createLineTable(), createOptionsLine(), “200”、“200”); panelGraph.setHeight("200"); panelGraph.setWidth("200"); panelGraph.add(时间线); } }; VisualizationUtils.loadVisualizationApi(onLoadCallback1, AnnotatedTimeLine.PACKAGE); g
Pannel Graph 在 ui.xml 中的定义如下
:HTMLPanel width = "200px" height="200px" ui:field="panelGraph"
I am trying to use AnnotatedTimeLine graph provided in GWT Visualization and i am getting following exception
com.google.gwt.core.client.JavaScriptException: (Error): Container height is zero. Expecting a valid height.
stack: Error: Container height is zero. Expecting a valid height.
My View class codes is like below
void onButtonLineGraphClick(ClickEvent event) {
Runnable onLoadCallback1 = new Runnable() {
public void run() {
AnnotatedTimeLine timeline = new AnnotatedTimeLine(createLineTable(), createOptionsLine(),
"200", "200");
panelGraph.setHeight("200");
panelGraph.setWidth("200");
panelGraph.add(timeline);
}
};
VisualizationUtils.loadVisualizationApi(onLoadCallback1, AnnotatedTimeLine.PACKAGE);
}
And Pannel Graph is defined like below in ui.xml
g:HTMLPanel width = "200px" height="200px" ui:field="panelGraph"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AnnotatedTimeLine 时间轴 = new AnnotatedTimeLine(createLineTable(), createOptionsLine(), "200", "200");
应替换为
AnnotatedTimeLine 时间轴 = new AnnotatedTimeLine(createLineTable(), createOptionsLine(), "200px", "200px");
终于明白了...
AnnotatedTimeLine timeline = new AnnotatedTimeLine(createLineTable(), createOptionsLine(), "200", "200");
Should be replace with
AnnotatedTimeLine timeline = new AnnotatedTimeLine(createLineTable(), createOptionsLine(), "200px", "200px");
finally got it...