use of org.netxms.ui.eclipse.charts.api.ChartColor in project netxms by netxms.
the class AvailabilityChart method createChart.
/**
* @param parent
* @param title
* @return
*/
private DataComparisonChart createChart(Composite parent, String title) {
DataComparisonChart chart = ChartFactory.createPieChart(parent, SWT.NONE);
chart.setTitleVisible(true);
chart.set3DModeEnabled(true);
chart.setChartTitle(title);
chart.setLegendVisible(false);
chart.setLabelsVisible(false);
chart.setRotation(225.0);
// $NON-NLS-1$
chart.addParameter(new GraphItem(0, 0, 0, DataType.FLOAT, Messages.get().AvailabilityChart_Up, Messages.get().AvailabilityChart_Up, "%s"), 100);
// $NON-NLS-1$
chart.addParameter(new GraphItem(0, 0, 0, DataType.FLOAT, Messages.get().AvailabilityChart_Down, Messages.get().AvailabilityChart_Down, "%s"), 0);
chart.setPaletteEntry(0, new ChartColor(127, 154, 72));
chart.setPaletteEntry(1, new ChartColor(158, 65, 62));
chart.initializationComplete();
GridData gd = new GridData();
gd.widthHint = 250;
gd.heightHint = 190;
((Control) chart).setLayoutData(gd);
return chart;
}
use of org.netxms.ui.eclipse.charts.api.ChartColor 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();
}
use of org.netxms.ui.eclipse.charts.api.ChartColor in project netxms by netxms.
the class LineChart method setAxisColor.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.charts.api.DataChart#setAxisColor(org.netxms.ui.eclipse.charts.api.ChartColor)
*/
@Override
public void setAxisColor(ChartColor color) {
final Color c = colors.create(color.getRGBObject());
getAxisSet().getXAxis(0).getTick().setForeground(c);
getAxisSet().getYAxis(0).getTick().setForeground(c);
}
use of org.netxms.ui.eclipse.charts.api.ChartColor in project netxms by netxms.
the class LineChart method setGridColor.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.charts.api.DataChart#setGridColor(org.netxms.ui.eclipse.charts.api.ChartColor)
*/
@Override
public void setGridColor(ChartColor color) {
final Color c = colors.create(color.getRGBObject());
getAxisSet().getXAxis(0).getGrid().setForeground(c);
getAxisSet().getYAxis(0).getGrid().setForeground(c);
}
use of org.netxms.ui.eclipse.charts.api.ChartColor in project netxms by netxms.
the class ServiceAvailability method createChart.
/**
* @param parent
* @param title
* @return
*/
private DataComparisonChart createChart(Composite parent, String title) {
DataComparisonChart chart = ChartFactory.createPieChart(parent, SWT.NONE);
chart.setTitleVisible(true);
chart.set3DModeEnabled(true);
chart.setChartTitle(title);
chart.setLegendVisible(false);
chart.setLabelsVisible(true);
chart.setRotation(225.0);
// $NON-NLS-1$
chart.addParameter(new GraphItem(0, 0, 0, DataType.FLOAT, Messages.get().ServiceAvailability_Up, Messages.get().ServiceAvailability_Up, "%s"), 100);
// $NON-NLS-1$
chart.addParameter(new GraphItem(0, 0, 0, DataType.FLOAT, Messages.get().ServiceAvailability_Down, Messages.get().ServiceAvailability_Down, "%s"), 0);
chart.setPaletteEntry(0, new ChartColor(127, 154, 72));
chart.setPaletteEntry(1, new ChartColor(158, 65, 62));
chart.initializationComplete();
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
((Control) chart).setLayoutData(gd);
return chart;
}
Aggregations