Optimale Datenstruktur (Datenbank)
Kategory | Wert |
---|---|
Bverages | 393 |
Condimants | 507 |
Confections | 386 |
Optimale Objektstruktur (Java)
public class PieChartObject { private String category; private Integer value; public String getCategory() { return this.category; } public void setCategory(final String category) { this.category = category; } public Integer getValue() { return this.value; } public void setValue(final Integer value) { this.value = value; } }
Beispiel: Füllen der Daten
final XdevPieChartModel model = new XdevPieChartModel(); new ProductDAO().getProductsByCategoryForChart().forEach(p -> { model.addItem(p.getCategory().getCategoryname(), (int) p.getAmount(), null); });