GWT Visualization AnnotatedTimeLine graph giving exception Container height is zero
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"); pa开发者_如何学JAVAnelGraph.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"
AnnotatedTimeLine timeline = new AnnotatedTimeLine(createLineTable(), createOptionsLine(), "200", "200");
Should be replace with
AnnotatedTimeLine timeline = new AnnotatedTimeLine(createLineTable(), createOptionsLine(), "200px", "200px");
finally got it...
精彩评论