icCube Visualization Library GWT Wrapper

The GWT Wrapper for the icCube Visualization Library is an open source project wrapping the icCube Javascript Visualization library and is available in Google projects (www). The main owner of this project is Xavi Vilajosana from Worldsensing S.L. It’s a project in its starting blocks so looking for contributors.

You will find more information in the project page, but here is a quick example from the author of how to use it:

1- Inherit the module in your gwt project: <inherits name='com.worldsensing.chartutils.CubeChartUtils'/>  

2- Add the JAR file library in your project classpath

3- Send an MDX query to the server and chart it!


Runnable onLoadCallback = new Runnable() {
  public void run() {

    String mdx="SELECT\n" +
               "  [Geography].[Geo].[Continent].members ON 0,\n" +
               "  [Time].[Calendar].[Month].members ON 1\n" +
               "FROM [sales]";                                

    // Get a cube connection

    CubeConnection con=new CubeWrapper().getCubeConnection("http://127.0.0.1:8282/icCube/gvi","admin","admin","Sales");

    // Options of the chart. As in GWT visualization..
    Options options=createOptions();

    // Place the chart in a specific div.
    RootPanel.get("result").add(new CubeWrapper().createChart(con,new CubeWrapper().AREA,options, mdx));

    // Place another chart in the root panel.
    RootPanel.get().add(new CubeWrapper().createChart(con,new CubeWrapper().BAR,options, mdx));
    }
  };

  // Load the visualization api, passing the onLoadCallback to be called
  VisualizationUtils.loadVisualizationApi(onLoadCallback,CoreChart.PACKAGE);
}