Search in sources :

Example 1 with Bar

use of com.extjs.gxt.charts.client.model.charts.BarChart.Bar in project activityinfo by bedatadriven.

the class ChartOFCView method addBarSeries.

private void addBarSeries(ChartModel cm, List<PivotTableData.Axis> categories, List<PivotTableData.Axis> series) {
    int index = 0;
    for (PivotTableData.Axis s : series) {
        String color = Theme.getAccent(index++);
        FilledBarChart bchart = new FilledBarChart(color, color);
        bchart.setTooltip("#x_label#<br>#val#");
        for (PivotTableData.Axis category : categories) {
            PivotTableData.Cell cell = category.getCell(s);
            double value = cell == null ? 0 : cell.getValue();
            Bar bar = new Bar(value);
            bar.setValue(value);
            bar.setTooltip(formatTooltip(s, category, value));
            bar.setValue(value);
            bchart.addBars(bar);
        }
        cm.addChartConfig(bchart);
    }
}
Also used : Bar(com.extjs.gxt.charts.client.model.charts.BarChart.Bar) PivotTableData(org.activityinfo.legacy.shared.reports.content.PivotTableData) FilledBarChart(com.extjs.gxt.charts.client.model.charts.FilledBarChart)

Aggregations

Bar (com.extjs.gxt.charts.client.model.charts.BarChart.Bar)1 FilledBarChart (com.extjs.gxt.charts.client.model.charts.FilledBarChart)1 PivotTableData (org.activityinfo.legacy.shared.reports.content.PivotTableData)1