use of org.netxms.ui.eclipse.charts.figures.BirtChartFigure in project netxms by netxms.
the class ObjectTooltip method addStatusChart.
/**
* Status chart
*/
private void addStatusChart(AbstractObject object, MapLabelProvider labelProvider) {
BirtChartFigure chart = new BirtChartFigure(BirtChartFigure.BAR_CHART, labelProvider.getColors());
add(chart);
GridData gd = new GridData();
gd.horizontalSpan = 2;
gd.horizontalAlignment = SWT.FILL;
gd.heightHint = 180;
gd.widthHint = 320;
setConstraint(chart, gd);
int[] objectCount = new int[6];
collectData(objectCount, object);
chart.setTitleVisible(true);
chart.setChartTitle(Messages.get().ObjectTooltip_ChartTitle);
chart.setLegendPosition(GraphSettings.POSITION_RIGHT);
chart.setLegendVisible(true);
chart.set3DModeEnabled(true);
chart.setTransposed(false);
chart.setTranslucent(false);
chart.setBorder(new LineBorder());
for (int i = 0; i <= ObjectStatus.UNKNOWN.getValue(); i++) {
// $NON-NLS-1$
chart.addParameter(// $NON-NLS-1$
new GraphItem(0, 0, 0, DataType.INT32, StatusDisplayInfo.getStatusText(i), StatusDisplayInfo.getStatusText(i), "%s"), objectCount[i]);
chart.setPaletteEntry(i, new ChartColor(StatusDisplayInfo.getStatusColor(i).getRGB()));
}
chart.initializationComplete();
}
Aggregations