...
Optimale Datenstruktur (Datenbank)
CondimantsCondiments | 507 |
Confections | 386 |
Optimale Objektstruktur (Java)
...
Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
firstline | 1 |
---|
linenumbers | true |
---|
|
final XdevPieChartModel model = new XdevPieChartModel();
model.addItem("Beverages", 393, null);
model.addItem("Condimants", 507, null);
model.addItem("Confections", 386, null);
chart.setModel(model); |
oder per Schleife aus Query-Methode:
Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
firstline | 1 |
---|
linenumbers | true |
---|
|
final XdevPieChartModel model = new XdevPieChartModel();
new ProductDAO().getProductsByCategoryForChart().forEach(p -> {
model.addItem(p.getCategory().getCategoryname(), (int) p.getAmount(), null);
});
chart.setModel(model);
|