Thanks for posting Rob. Exciting to see GWT Highcharts in use within the gwt-cx project!
Regarding the layout on the showcase landing page: we're just using the standard SmartGWT HLayout/VLayout containers for that, setting the appropriate "width" or "height" properties to "*" to handle the resizing case. E.g. here's the code for the guts of how that pane is setup:
However, if you place another chart into a layout (as per the commented code) you run into a few sizing issues.
It's fine the first time the "view" (Dashboards View) is selected (chosen via the Navigation Pane). And, if you manually re-size the browser window its fine. But, if you navigate between views (e.g. click Activities then click Dashboards) the heights are OK but the layouts are double the viewport width:
|XX|
|XX|
|X X |
|X X |
If you then manually re-size the browser window the charts will jump back into the correct place.
Have you tried placing more than one chart in a layout and then toggled between views?
Cheers
Rob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does the SmartGWT layout work correctly when you just place a regular SmartGWT widget in the containers instead of the chart widget? If so, I think you're probably being affected by the chart's size not being recalculated until after the SmartGWT containers are re-laid out, so SmartGWT is getting confused by the child widgets being bigger than the space available. If that is the case, you may be able to fix it by placing the chart in a separate "container" canvas, and then using the SmartGWT ResizedEvent and DrawEvent to control the size of the chart. E.g. something like:
final Canvas chartContainer = new Canvas();
final WidgetCanvas widgetCanvas = new WidgetCanvas(myChartWidget);
chartContainer.addResizedHandler(new ResizedHandler() {
public void onResized(ResizedEvent event) {
chart.setSize(chartContainer.getWidth(), chartContainer.getHeight(), false);
}
});
chartContainer.addDrawHandler(new DrawHandler() {
public void onDraw(DrawEvent event) {
chart.setSize(chartContainer.getWidth(), chartContainer.getHeight(), false);
}
});
chartContainer.addChild(widgetCanvas);
panel.addMember(chartContainer);
Keep us posted if that helps at all...
-Shawn
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for posting Rob. Exciting to see GWT Highcharts in use within the gwt-cx project!
Regarding the layout on the showcase landing page: we're just using the standard SmartGWT HLayout/VLayout containers for that, setting the appropriate "width" or "height" properties to "*" to handle the resizing case. E.g. here's the code for the guts of how that pane is setup:
I hope that helps, but just let me know if you run into trouble.
Hi Shawn,
The following works Ok with one chart in the North layout and one chart in the South layout:
However, if you place another chart into a layout (as per the commented code) you run into a few sizing issues.
It's fine the first time the "view" (Dashboards View) is selected (chosen via the Navigation Pane). And, if you manually re-size the browser window its fine. But, if you navigate between views (e.g. click Activities then click Dashboards) the heights are OK but the layouts are double the viewport width:
|XX|
|XX|
|X X |
|X X |
If you then manually re-size the browser window the charts will jump back into the correct place.
Have you tried placing more than one chart in a layout and then toggled between views?
Cheers
Rob
Hi Rob,
Does the SmartGWT layout work correctly when you just place a regular SmartGWT widget in the containers instead of the chart widget? If so, I think you're probably being affected by the chart's size not being recalculated until after the SmartGWT containers are re-laid out, so SmartGWT is getting confused by the child widgets being bigger than the space available. If that is the case, you may be able to fix it by placing the chart in a separate "container" canvas, and then using the SmartGWT ResizedEvent and DrawEvent to control the size of the chart. E.g. something like:
Keep us posted if that helps at all...
Hi Shawn,
Thanks, yes it was a smartGWT layout issue.
I have updated the gwt-cx demo:
-> http://gwt-cx.com/serendipity/Serendipity.html
Thanks again for your help.
Cheers
Rob
Last edit: Rob 2011-11-16