Inhalt:
Optimale Datenstruktur (Datenbank):Kategorie | Y-Achse | X-Achse |
---|
Beverages | 2017 | 550 |
Beverages | 2018 | 540 |
Condiments | 2017 | 350 |
... |
|
|
Optimale Objektstruktur (Java):
Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
firstline | 1 |
---|
linenumbers | true |
---|
|
public class ComboChartObject {
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: Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
firstline | 1 |
---|
linenumbers | true |
---|
|
//Erstellen Model und hinzufügen der Kategorien
final XdevComboChartModel model = new XdevComboChartModel();
model.addCategory("2017");
model.addCategory("2018");
//Füllen der Items
model.addItem("Beverages", "2017", 560);
model.addItem("Beverages", "2018", 560);
model.addItem("Condiments", "2017", 530);
model.addItem("Condiments", "2018", 530);
//Setzen des Models
comboChart.setModel(model); |
API und Methoden:
Füllen und Definieren der Kategorien
...