Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

  

Optimale Datenstruktur (Datenbank)

KategoryWert
Bverages393
Condimants507
Confections386

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);
});
  • No labels