Search in sources :

Example 1 with ISeriesSet

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);
        }
    }
}
Also used : ISeriesSet(org.swtchart.ISeriesSet) IMonitoredMXBeanAttribute(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanAttribute) ISeries(org.swtchart.ISeries)

Example 2 with ISeriesSet

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);
}
Also used : ISeriesSet(org.swtchart.ISeriesSet) IAxisTick(org.swtchart.IAxisTick) IAxisSet(org.swtchart.IAxisSet) SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) Color(org.eclipse.swt.graphics.Color) ITitle(org.swtchart.ITitle) SimpleDateFormat(java.text.SimpleDateFormat) Chart(org.swtchart.Chart) IAxis(org.swtchart.IAxis)

Aggregations

ISeriesSet (org.swtchart.ISeriesSet)2 DateFormat (java.text.DateFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Color (org.eclipse.swt.graphics.Color)1 Chart (org.swtchart.Chart)1 IAxis (org.swtchart.IAxis)1 IAxisSet (org.swtchart.IAxisSet)1 IAxisTick (org.swtchart.IAxisTick)1 ISeries (org.swtchart.ISeries)1 ITitle (org.swtchart.ITitle)1 IMonitoredMXBeanAttribute (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanAttribute)1