Illustration einer tropischen Insel mit Palmen und einem hohen Berg

Java Blog für Programmierer

GWT Charting Bibliothek gflot und charts4j.

· Christian Ullenboom

Alles fängt mit http://jquery.com/ an. Darauf baut auf http://code.google.com/p/flot/, eine JavaScript-Bib. für Chars:

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

Kategorien: GWT, Open Source, Web Frameworks

← Alle Beiträge