Menu

Problem with GWT Highcharts, GWT and SmartGWT

2012-03-26
2012-07-13
  • Shawn Quinn

    Shawn Quinn - 2012-03-26

    Hi Justin,

    We use SmartGWT here with success, and the GWT Highcharts showcase application is also a SmartGWT application. However, there is a known compatibility problem with using custom widgets (unrelated to GWT Highcharts) in SmartGWT layouts when running in dev/hosted mode. Can you confirm if the problem you're seeing goes away when running in full scripted/compiled mode?

    There is also some additional information in the following thread in case it's useful.

    https://sourceforge.net/p/gwt-highcharts/discussion/general/thread/74f73195/

    I'm hoping someone at Isomorphic will give this some attention so we can better utilize custom GWT widgets in SmartGWT when running in hosted mode as well! Any attention you can help draw to this issue would be appreciated.

    Thanks,

       -Shawn
    
     
  • Shawn Quinn

    Shawn Quinn - 2012-03-28

    Just let me know if you guys have any ideas on things we could/should do in GWT Highcharts to make working with SmartGWT easier! We obviously don't want to make GWT Highcharts depend on SmartGWT, but if there are tricks to get BaseChart to behave nicer within SmartGWT I'm all ears.

    We also use SmartGWT for most of our apps here, and would certainly benefit from having a way to run things in dev/hosted mode as well. When we first published GWT Highcharts last year it looked like Isomorphic might be working on this issue so I was hopeful that they'd get this fixed (as it affects many other GWT widgets as well). But, it's been quite awhile with no progress, so it might be time to try and find other workarounds.

    BTW - In case it's of use to others, the following is the type we've been using in our applications for including a GWT Highchart within a SmartGWT layout where we want the chart to match the size of the container:

    import com.smartgwt.client.widgets.WidgetCanvas;
    import com.smartgwt.client.widgets.events.DrawEvent;
    import com.smartgwt.client.widgets.events.DrawHandler;
    import com.smartgwt.client.widgets.events.ResizedEvent;
    import com.smartgwt.client.widgets.events.ResizedHandler;
    import org.moxieapps.gwt.highcharts.client.BaseChart;
    
    /**
     * A SmartGWT container widget that will contain a GWT Highchart and automatically
     * handle growing/shrinking the chart as the SmartGWT container changes in size.
     *
     * @author squinn@moxiegroup.com (Shawn Quinn)
     * @since 1.0
     */
    public class ResizeableChartCanvas extends WidgetCanvas {
    
        public ResizeableChartCanvas(final BaseChart chart) {
            super(chart);
            chart.setReflow(false);
            final WidgetCanvas wc = this;
            this.addResizedHandler(new ResizedHandler() {
                public void onResized(ResizedEvent event) {
                    chart.setSize(wc.getWidth(), wc.getHeight(), false);
                }
            });
            this.addDrawHandler(new DrawHandler() {
                public void onDraw(DrawEvent event) {
                    chart.setSize(wc.getWidth(), wc.getHeight(), false);
                }
            });
            wc.setOverflow(Overflow.HIDDEN);
        }
    }
    
     

    Last edit: Shawn Quinn 2012-04-06

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.