Search in sources :

Example 1 with LineChart

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

the class ChartOFCView method addLineSeries.

private void addLineSeries(ChartModel cm, List<PivotTableData.Axis> categories, List<PivotTableData.Axis> series) {
    int index = 0;
    for (PivotTableData.Axis s : series) {
        String color = Theme.getAccent(index++);
        LineChart lineChart = new LineChart();
        lineChart.setTooltip("#x_label#<br>#val#");
        lineChart.setColour(color);
        lineChart.setDotStyle(new SolidDot());
        for (PivotTableData.Axis category : categories) {
            PivotTableData.Cell cell = category.getCell(s);
            double value = cell == null ? 0 : cell.getValue();
            BaseDot d = new Dot(5);
            d.setSize(5);
            d.setColour(color);
            d.setTooltip(formatTooltip(s, category, value));
            d.setValue(value);
            lineChart.addDots(d);
        }
        cm.addChartConfig(lineChart);
    }
}
Also used : PivotTableData(org.activityinfo.legacy.shared.reports.content.PivotTableData) SolidDot(com.extjs.gxt.charts.client.model.charts.dots.SolidDot) Dot(com.extjs.gxt.charts.client.model.charts.dots.Dot) BaseDot(com.extjs.gxt.charts.client.model.charts.dots.BaseDot) SolidDot(com.extjs.gxt.charts.client.model.charts.dots.SolidDot) BaseDot(com.extjs.gxt.charts.client.model.charts.dots.BaseDot) LineChart(com.extjs.gxt.charts.client.model.charts.LineChart)

Aggregations

LineChart (com.extjs.gxt.charts.client.model.charts.LineChart)1 BaseDot (com.extjs.gxt.charts.client.model.charts.dots.BaseDot)1 Dot (com.extjs.gxt.charts.client.model.charts.dots.Dot)1 SolidDot (com.extjs.gxt.charts.client.model.charts.dots.SolidDot)1 PivotTableData (org.activityinfo.legacy.shared.reports.content.PivotTableData)1