title: gwt-charts library - not printing the graph
body: <p>I am developing a GUI with GWT and the gwt-chart library. However, when printing the graphs, the application is locked and nothing is displayed in the screen. The code is the following:</p>
  
  <pre><code>public HorizontalPanel printGraph(Map&lt;String, Map&lt;String, Map&lt;String, String&gt;&gt;&gt; hmMonthData, String sSelectedZone){
      atlHorizontalPanel.setSpacing(15);
      atlHorizontalPanel.setBorderWidth(0);
  
      //If the data is not collected, no graph should be displayed
      if(hmMonthData.size() &gt; 0){
  
          //Get the list of values of the sensors in the Zone visible in the stack panel
          final Map&lt;String, Map&lt;String,String&gt;&gt; hmSensorsByZone = hmMonthData.get(sSelectedZone);
  
          //Get the list of sensors associated to the Zone selected
          Object[] asSensors = hmSensorsByZone.keySet().toArray();
  
          //Only if the length of sensors is upper than 0
          if(asSensors.length &gt; 0){
  
              final List&lt;String&gt; lsSensors = new ArrayList&lt;String&gt;();
  
              for(int i = 0; i &lt; asSensors.length; i++){
                  lsSensors.add(asSensors[i].toString());
              }
  
              //Creating the chart
              ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART);
              chartLoader.loadApi(new Runnable() {
                  @Override
                  public void run() {
                      // call method to create and show the chart
                      DataTable dataTable = DataTable.create();
  
                      //Columnas a mostrar, la primera para el eje de abscisas (fecha) y la segunda para
                      //los valores en el eje de ordenadas
                      dataTable.addColumn(ColumnType.DATE, "Date");
  
                      for(String sSensor : lsSensors){
                          dataTable.addColumn(ColumnType.NUMBER, sSensor);
                      }
  
                      DateTimeFormat dtf = DateTimeFormat.getFormat("dd/MM/yy hh:mm:ss");
  
                      //Se añaden los valores y los puntos para dibujar la gráfica
                      for(int j = 0; j &lt; lsSensors.size(); j++){
                          //Delete all the rows related to the sensor j
  
                          Map&lt;String,String&gt; hmValues = hmSensorsByZone.get(lsSensors.get(j));
  
                          //Only if the size of the values is upper than 0
                          if(hmValues.size() &gt; 0){
  
                              Object[] asTimestamps = (Object[]) hmValues.keySet().toArray(); 
                              Object[] asValues = (Object[]) hmValues.values().toArray(); 
  
                              if(dataTable.getNumberOfRows() &lt; asTimestamps.length)
                                  dataTable.addRows(asTimestamps.length - dataTable.getNumberOfRows()); 
  
                              for(int i = 0; i &lt; asTimestamps.length; i++){
                                  String sTimestamp = asTimestamps[i].toString();
                                  String sValue = asValues[i].toString();
                                  Double dValue = Double.valueOf(sValue);
  
                                  dataTable.setValue(i, 0,    dtf.parse(sTimestamp)); 
                                  dataTable.setValue(i, j+1, dValue);
                              }
                          }
                      }
  
                      LineChartOptions options = LineChartOptions.create();
                      options.setAxisTitlesPosition(AxisTitlesPosition.IN);
                      ChartArea chartArea = ChartArea.create(); 
                      chartArea.setWidth(500);
                      chartArea.setHeight(350);
                      options.setChartArea(chartArea);
  
                      LineChart lineChart = new LineChart();
                      lineChart.draw(dataTable, options);
  
                      atlHorizontalPanel.add(lineChart);
  
                  }
              });
          }   
      }
      else{
          //Creating the chart
          ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART);
          chartLoader.loadApi(new Runnable() {
              @Override
              public void run() {
                  // call method to create and show the chart
                  DataTable data = DataTable.create();
                  data.addColumn(ColumnType.DATE, "Date");
                  data.addColumn(ColumnType.NUMBER, "Value");
                  data.addRows(1);
                  DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy.MM.dd hh:mm");
                  data.setValue(0, 0, dtf.parse("2014.01.01 00:00")); 
  
                  LineChartOptions options = LineChartOptions.create();
                  options.setAxisTitlesPosition(AxisTitlesPosition.IN);
                  ChartArea chartArea = ChartArea.create(); 
                  chartArea.setWidth(500);
                  chartArea.setHeight(350);
                  options.setChartArea(chartArea);
  
                  LineChart lineChart = new LineChart();
                  lineChart.draw(data, options);
  
                  atlHorizontalPanel.add(lineChart);
  
              }
          });
      }
  
      return atlHorizontalPanel;
  }
  </code></pre>
  
  <p>I am new with this library, so, what am I doing wrong? Thank you in advance.</p>