use of com.extjs.gxt.charts.client.model.ChartModel in project activityinfo by bedatadriven.
the class ChartOFCView method show.
/**
* Updates the view to the given PivotChartContent
*
* @param element
*/
@Override
public void show(PivotChartReportElement element) {
if (isRendered()) {
el().unmask();
}
PivotChartContent content = element.getContent();
PivotTableData table = element.getContent().getData();
if (gridPanel != null) {
gridPanel.show(element);
}
List<PivotTableData.Axis> categories = table.getRootRow().getLeaves();
List<PivotTableData.Axis> series = table.getRootColumn().getLeaves();
ChartModel cm = new ChartModel();
cm.setBackgroundColour(TRANSPARENT_BG);
cm.setNumDecimals(0);
cm.setDecimalSeparatorComma(true);
cm.setXAxis(createXAxis(categories));
cm.setYAxis(createYAxis(content, table));
switch(element.getType()) {
case Bar:
case StackedBar:
case ClusteredBar:
addBarSeries(cm, categories, series);
break;
case Pie:
addPieChart(cm, categories, series);
break;
case Line:
addLineSeries(cm, categories, series);
break;
}
setModel(cm);
}
Aggregations