Menu

Moxie chart cannot auto resize

tvhnet
2012-03-21
2013-11-05
  • tvhnet

    tvhnet - 2012-03-21

    Hi,

    I put a moxie chart in the center of a DockLayoutPanel. The chart is not auto resized when I call DockLayoutPanel.setWidgetSize(...).

    Can you help me?

    Thanks,

    Here is my code:

    private Chart dataSetTest()
        {
            Chart chart = new Chart();
            chart.getXAxis()
                    .setType(Axis.Type.DATE_TIME);
    
            long t = new Date().getTime();
            for (int j = 0; j < 5; j++)
            {
                Series series = chart.createSeries();
                for (int i = 0; i < 10; i++)
                {
                    series.addPoint(new Point(t + i * 1000, Random.nextDouble()));
                }
                chart.addSeries(series);
            }
    
            chart.setWidth100();
            chart.setHeight100();
            return chart;
        }
    
        void test()
        {
            DockLayoutPanel panel = new DockLayoutPanel(Unit.PX);
            HTML westWidget = new HTML("west");
            panel.addWest(westWidget, 0);
            panel.add(dataSetTest());
            RootLayoutPanel.get().add(panel);
    
            panel.setWidgetSize(westWidget, 200);
        }
    
     
  • Ronan Quillevere

    I am facing the same kind of problem with a herarchy of providesresize component. The setWidgetSize should be sufficient IMO as it will call the layout and the resize on all children.

    In my case calling the force layout does not improve my situation. Will continue to search the explanation.

     

    Last edit: Ronan Quillevere 2013-11-05

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.