GWT Charting Bibliothek gflot und charts4j.
Alles fängt mit http://jquery.com/ an. Darauf baut auf http://code.google.com/p/flot/, eine JavaScript-Bib. für Chars:
- Basic example
- Different graph types and setting various options
- Turning series on/off
- Selection support and zooming and zooming with overview
- Plotting time series and visitors per day with zooming and weekends
- Dual axis support
- Interacting with the data
http://code.google.com/p/gflot/ ist nun der GWT-Aufsatz auf flot.
Für eine Bar-Diagramm ist nur folgender Quellcode nötig:
final String[] MONTH_NAMES = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" };PlotModel model = new PlotModel();PlotOptions plotOptions = new PlotOptions();BarSeriesOptions barSeriesOptions = new BarSeriesOptions();barSeriesOptions.setShow(true);barSeriesOptions.setLineWidth(1);barSeriesOptions.setBarWidth(1);barSeriesOptions.setAlignment(BarAlignment.CENTER);plotOptions.setDefaultBarsSeriesOptions(barSeriesOptions);plotOptions.setLegendOptions(new LegendOptions().setShow(false));// add tick formatter to the optionsplotOptions.setXAxisOptions(new AxisOptions().setTicks(12).setTickFormatter(new TickFormatter() { public String formatTickValue(double tickValue, Axis axis) { if (tickValue > 0 && tickValue