Announcement

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

    Google Charts inside Portlets

    This is my current application environment :
    1) Java 1.5, Smart GWT 2.2, GWT 2.0.3
    2) All data sources are JSON RestDataSources.

    Our application has a screen with com.smartgwt.client.widgets.layout.PortalLayout to show portlets. We are using google visualization api charts in some of the portlets. But the issue is portlets with charts have following screen drawing problems.

    1) It doesn't draw a chart if the chart is added to the portlet in usual way.
    ex: portlet.addItem(new BarChart(tDDgs, tOptions));

    We have fixed this issue by following code.

    final Portlet portlet = new Portlet();
    portlet.setTitle(_title);
    portalLayout.addPortlet(portlet);

    portlet.addResizedHandler(new ResizedHandler() {
    public void onResized(ResizedEvent event) {
    for (Canvas w : portlet.getItems()) {
    portlet.removeItem(w);
    }
    portlet.addItem(new BarChart(tDDgs, tOptions));
    }
    });


    2) Still we have the drawing issue once user maximize the PortalLayout and restore it. It doesn't show the chart portlet.

    3) Chart doesn't size to the size of the pane and many times we dont see the scrollbar either until all other portlets are minimised.

    Please help on these above issues.

    #2
    We had many problems trying to to use the visualization api within the portlets. The biggest ended up being a memory leak we could not get rid of. We ended up switching and using HighCharts. http://www.highcharts.com/

    Comment


      #3
      Hi guys, we did take a look at the issues with Google Visualizations and ultimately it seemed that Google Visualizations had problems with resizing when placed within DOM containers that we could not address without changing Google Visualizations itself.

      Given that it's a Flash-based solution we don't really recommend it at all (compared to HTML5 charting such as our or high charts). But if you're going to use it, design your application so it can remain fixed size.

      Comment


        #4
        Does HighCharts support GWT ? If not, do you know any other Chart provider support GWT ?

        Comment


          #5
          Highcharts is all javascript so you'll have to write your own GWT wrapper. Depending on what you want to do with the charts, you only need to wrap up the things you need. Although if resizing is really important, I can tell you that we didn't implement that because of time constraints so I don't know how well that works.

          Comment


            #6
            Hi oddjobdev,

            Are you willing to give your GWT wrappers for Highcharts to Opensource ? Or We like to buy those since our requirement is very important.

            Comment


              #7
              Why would you do that? The FacetChart in the Analytics module is already available in SmartGWT and is pre-integrated with various SmartGWT components. It's far less work to use now and to maintain, will support more and more out-of-the-box integration with SmartGWT DataSources and UI components over time, and doesn't require you to purchase and manage a separate license from another company with different terms.

              Comment


                #8
                Is the FacetChart chart fairly new? I don't remember that being in the LGPL version since 2.0. The only reason we were forced to use a third party app was because we have 2 GWT apps that both use the chart and SmartGWT was only available in one of the Apps.

                Comment


                  #9
                  Fairly new, yes - see this blog post. And note, it's part of the Analytics Module, not LGPL.

                  Comment


                    #10
                    FYI - We recently released the "GWT Highcharts" project as open source, which provides a complete (pure Java) GWT wrapper for Highcharts (and works within a SmartGWT container as well):

                    http://www.moxiegroup.com/moxieapps/gwt-highcharts/

                    Off of that page you'll find a link to the "Showcase" application which is actually a SmartGWT application.

                    Comment

                    Working...
                    X