BarChart / ColumnChart
Optimal object structure (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;
}
}
Example
// Create model
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"));
// Add items to model
model.addRow("2014", 1500, 1200);
model.addRow("2015", 805, 700);
model.addRow("2016", 920, 600);
model.addRow("2017", 1250, 1500);
// Set model
barChart.setModel(model);
API and methods
Properties | |
---|---|
Orientation |
The orientation of the chart. When set to`'vertical'`, rotates the axes of the chart so that (for instance) a column chart becomes a bar chart, and an area chart grows rightward instead of up:
|
StackMode |
The options for
|
Configuration of texts and legends see API General