Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    AnnotatedTimeline error

    I am trying to use the Google Visualization API to provide an annotated timeline visualization. I included a small testcase which demonstrates the error.

    Anyone know how I can set the height and width of the container from a 'GWT Visualization' perspective ?
    Alternatively other ways of fixing this, I have tried wrapping it in a SimplePanel and setting the size on that but with the same result. I also tried putting it in a Canvas with a configured size.

    Code:
    public class Test implements EntryPoint {
    
        public void onModuleLoad() {
            final Canvas c = new Canvas();
            c.setHeight("800");
            c.setWidth("1000");
            c.setBackgroundColor("#FF0000");
            VisualizationUtils.loadVisualizationApi(new Runnable() {
                @Override
                public void run() {
                    AnnotatedTimeLine t = new AnnotatedTimeLine("800", "500");
                    DataTable data = DataTable.create();
                    c.addChild(t);
                    t.draw(data);
                }
            }, AnnotatedTimeLine.PACKAGE);
            c.draw();
        }
    }
    com.google.gwt.core.client.JavaScriptException: (Error): Container width is zero. Expecting a valid width.
    fileName: http://www.google.com/uds/api/visual...ine+en_US.I.js
    Last edited by rvsjoen; 26 Feb 2010, 12:56.
Working...
X