use of org.swtchart.ISeriesSet in project tdi-studio-se by Talend.
the class TimelineChart method deleteMonitoredSeries.
/**
* Delete series if not monitored any longer.
*/
private void deleteMonitoredSeries() {
ISeriesSet seriesSet = getSeriesSet();
List<IMonitoredMXBeanAttribute> attributes = attributeGroup.getAttributes();
for (ISeries series : seriesSet.getSeries()) {
String seriesId = series.getId();
boolean found = false;
for (IMonitoredMXBeanAttribute attribute : attributes) {
if (series.getId().equals(getSeriesId(attribute))) {
found = true;
}
}
if (!found) {
seriesSet.deleteSeries(seriesId);
}
}
}
use of org.swtchart.ISeriesSet in project ACS by ACS-Community.
the class AlarmsPerTenMinutesPart method createPartControl.
public void createPartControl(Composite parent) {
chart = new Chart(parent, SWT.NONE);
ITitle chartTitle = chart.getTitle();
chartTitle.setText("Alarms per 10 minutes");
IAxisSet axisSet = chart.getAxisSet();
IAxis[] xAxis = axisSet.getXAxes();
ITitle xTitle = xAxis[0].getTitle();
xTitle.setText("Time");
IAxis[] yAxis = axisSet.getYAxes();
ITitle yTitle = yAxis[0].getTitle();
yTitle.setText("# alarms");
ISeriesSet seriesSet = chart.getSeriesSet();
nAlarmsSerie = (ILineSeries) seriesSet.createSeries(SeriesType.LINE, "nAlarms");
nAlarmsSerie.enableStep(true);
nAlarmsSerie.setSymbolType(PlotSymbolType.NONE);
IAxisTick xTick = axisSet.getXAxis(0).getTick();
DateFormat format = new SimpleDateFormat("HH:mm");
xTick.setFormat(format);
errorSerie = (ILineSeries) seriesSet.createSeries(SeriesType.LINE, "Threshold");
errorSerie.setSymbolType(PlotSymbolType.NONE);
errorColor = new Color(Display.getDefault(), 255, 0, 0);
errorSerie.setLineColor(errorColor);
TenMinutesContainer.getInstance().setChartViewer(this);
}
Aggregations