List of usage examples for com.google.gwt.visualization.client AbstractDataTable getColumnLabel
public final native String getColumnLabel(int columnIndex) ;
From source file:com.google.gwt.visualization.sample.customvisualization.client.CustomVisualization.java
License:Apache License
@Override public void draw(AbstractDataTable dataTable, CustomVisualizationDrawOptions options) { grid.clear();/*from ww w.ja va 2s . com*/ // Apply the drawing options if (options != null) { grid.getElement().getStyle().setProperty("backgroundColor", options.getBackgroundColor()); } for (int c = 0; c < dataTable.getNumberOfColumns(); c++) { grid.setHTML(0, c, "<b>" + dataTable.getColumnLabel(c) + "</b>"); } for (int r = 0; r < dataTable.getNumberOfRows(); r++) { for (int c = 0; c < dataTable.getNumberOfColumns(); c++) { grid.setText(r + 1, c, dataTable.getFormattedValue(r, c)); } } // handle selection grid.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { cell = grid.getCellForEvent(event); CustomVisualization.this.fireSelectionEvent(); } }); }