BarChart / ColumnChart
Beispiel:
Inhalt:
Optimale Datenstruktur (Datenbank):
Y-Achse | Kategorie | X-Achse |
---|---|---|
Beverages | 2017 | 550 |
Beverages | 2018 | 550 |
Optimale Objektstruktur (Java):
public class BarChartObject { private String yvalue; private String category; private Integer xvalue; public String getYvalue() { return this.yvalue; } public void setYvalue(final String yvalue) { this.yvalue = yvalue; } public String getCategory() { return this.category; } public void setCategory(final String category) { this.category = category; } public Integer getXvalue() { return this.xvalue; } public void setXvalue(final Integer xvalue) { this.xvalue = xvalue; } }
Beispiel fĂĽllen der Daten:
//Erstellen Model und hinzufĂĽgen der Kategorien final ChartModel model = ChartModel.New() .addColumn(Column.New(Type.STRING, "year", "Jahr")) .addColumn(Column.New(Type.NUMBER, "iphone", "iPhone")) .addColumn(Column.New(Type.NUMBER, "android", "Android")); //FĂĽllen der Items model.addRow("2014", 1500, 1200); model.addRow("2015", 805, 700); model.addRow("2016", 920, 600); model.addRow("2017", 1250, 1500); //Setzen des Models barChart.setModel(model);
API und Methoden:
Properties | |
---|---|
Orientation | The orientation of the chart. When set to this.barChart.setOrientation(Orientation.VERTICAL); |
StackMode | The options forÂ
this.barChart.setStackMode(StackMode.TRUE); |
Konfiguration von Texten und Legenden siehe API Allgemein
XDEV Software Corp. - One Embarcadero Center, San Francisco, CA 94111, US
Copyright © 2015. XDEV Software Corp. All rights reserved.