Menu

Highcharts in SmartGWT Portlets

Chris
2012-04-24
2012-04-25
  • Chris

    Chris - 2012-04-24

    I am having trouble getting multiple charts to show up properly on a single page when each is inside of a separate SmartGWT portlet. Initially they show up fine, but then there is some weird behavior with resizing and general portlet functionality. For instance:

    1) When the portlet becomes minimized so that it is collapsed fully the header bar of the portlet is no longer clickable; there is no way to close or maximize it again.
    2) Sometimes when resizing a portlet the chart inside does not automatically resize unless the chart is zoomed in then zoomed back out, using the built in zooming functionality of highcharts.

    Here are the steps I'm taking:
    1) Create a GWT highchart
    2) Add chart to a canvas using addChild(..)
    3) Override the canvases resize handler and set the size of the chart to the size of the canvas
    4) Add canvas to a portlet using addMember(..)

    I have no idea if this is a problem with my implementation, GWT highcharts, highcharts, or SmartGWT so I'm hoping someone else has done something similar and can help me narrow it down.

    Thanks,
    Chris

     
  • Chris

    Chris - 2012-04-24

    So after posting I found this post here Problem with GWT Highcharts, GWT and SmartGWT. If I use the ResizeableChartCanvas and add a VisibilityChangedHandler I can fix the first problem I reported; basically the chart needs to be explicitly hidden when the canvas is hidden. Thank you for posting that code snippet. But the chart not resizing properly in a portlet remains. If I figure out while I'll report back.

     
  • Shawn Quinn

    Shawn Quinn - 2012-04-25

    Not sure if this is related to the problem you're seeing, but you may want to consider setting the "reflow" option to false if you're managing the size of the chart on your own. See: http://www.moxiegroup.com/moxieapps/gwt-highcharts/apidocs/org/moxieapps/gwt/highcharts/client/BaseChart.html#setReflow(boolean) .

    Also, not sure if you're using SmartGWT's resize bars, but if you are you may want to give this thread a look.

    If you still have trouble though, if you can boil your scenario down to a simple use case and post the code here - someone may be able to offer more specific ideas.

     

Log in to post a comment.