use of org.eclipse.swtchart.IPlotArea in project netxms by netxms.
the class LineChart method setZoomEnabled.
/**
* @param enableZoom
*/
private void setZoomEnabled(boolean enableZoom) {
final IPlotArea plotArea = getPlotArea();
if (enableZoom) {
plotArea.addMouseListener(zoomMouseListener);
plotArea.getControl().addPaintListener(zoomPaintListener);
} else {
plotArea.removeMouseListener(zoomMouseListener);
plotArea.getControl().removePaintListener(zoomPaintListener);
}
}
use of org.eclipse.swtchart.IPlotArea in project swtchart by eclipse.
the class LineSeries_10_Part method initialize.
private void initialize() throws Exception {
/*
* Chart Settings
*/
IChartSettings chartSettings = getChartSettings();
chartSettings.setCreateMenu(true);
applySettings(chartSettings);
/*
* Create series.
*/
List<ILineSeriesData> lineSeriesDataList = new ArrayList<ILineSeriesData>();
//
ISeriesData seriesData;
ILineSeriesData lineSeriesData;
ILineSeriesSettings lineSeriesSettings;
/*
* Chromatogram [0]
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(true);
ILineSeriesSettings lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Active Peaks [1]
*/
indexSeries = 1;
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_ACTIVE_PEAKS);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(false);
lineSeriesSettings.setLineStyle(LineStyle.NONE);
lineSeriesSettings.setSymbolType(PlotSymbolType.INVERTED_TRIANGLE);
lineSeriesSettings.setSymbolSize(5);
lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_GRAY));
lineSeriesSettings.setSymbolColor(getDisplay().getSystemColor(SWT.COLOR_GRAY));
lineSeriesDataList.add(lineSeriesData);
/*
* Set series.
*/
addSeriesData(lineSeriesDataList);
/*
* Add the label marker.
*/
IPlotArea plotArea = (IPlotArea) getBaseChart().getPlotArea();
LabelMarker labelMarker = new LabelMarker(getBaseChart());
List<String> labels = new ArrayList<String>();
labels.add("[1]");
labels.add("[2]");
labels.add("[3]");
labels.add("[4]");
labels.add("[5]");
labels.add("[6]");
labels.add("[7]");
labels.add("[8]");
labels.add("[9]");
labels.add("[10]");
labelMarker.setLabels(labels, indexSeries, SWT.HORIZONTAL);
plotArea.addCustomPaintListener(labelMarker);
}
use of org.eclipse.swtchart.IPlotArea in project swtchart by eclipse.
the class LineSeries_1_Part method initialize.
private void initialize() throws Exception {
/*
* Chart Settings
*/
IChartSettings chartSettings = getChartSettings();
chartSettings.setCreateMenu(true);
applySettings(chartSettings);
/*
* Create series.
*/
List<ILineSeriesData> lineSeriesDataList = new ArrayList<ILineSeriesData>();
//
ISeriesData seriesData;
ILineSeriesData lineSeriesData;
ILineSeriesSettings lineSeriesSettings;
ILineSeriesSettings lineSeriesSettingsHighlight;
/*
* Chromatogram [0]
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(true);
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Baseline [1]
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_BASELINE);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(true);
lineSeriesSettings.setSymbolType(PlotSymbolType.NONE);
lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Selected Scans [2]
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_SELECTED_SCANS);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setLineStyle(LineStyle.NONE);
lineSeriesSettings.setSymbolType(PlotSymbolType.CROSS);
lineSeriesSettings.setSymbolSize(5);
lineSeriesSettings.setSymbolColor(getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Active Peaks [3]
*/
indexSeries = 3;
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_ACTIVE_PEAKS);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(false);
lineSeriesSettings.setLineStyle(LineStyle.NONE);
lineSeriesSettings.setSymbolType(PlotSymbolType.INVERTED_TRIANGLE);
lineSeriesSettings.setSymbolSize(5);
lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_GRAY));
lineSeriesSettings.setSymbolColor(getDisplay().getSystemColor(SWT.COLOR_GRAY));
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Inactive Peaks
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_INACTIVE_PEAKS);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(false);
lineSeriesSettings.setLineStyle(LineStyle.NONE);
lineSeriesSettings.setSymbolType(PlotSymbolType.INVERTED_TRIANGLE);
lineSeriesSettings.setSymbolSize(5);
lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_GRAY));
lineSeriesSettings.setSymbolColor(getDisplay().getSystemColor(SWT.COLOR_GRAY));
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Peak 1
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_SELECTED_PEAK_1);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(true);
lineSeriesSettings.setSymbolType(PlotSymbolType.CIRCLE);
lineSeriesSettings.setSymbolColor(getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
lineSeriesSettings.setSymbolSize(2);
lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Background 1
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_SELECTED_PEAK_1_BACKGROUND);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(true);
lineSeriesSettings.setSymbolType(PlotSymbolType.NONE);
lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Peak 2
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_SELECTED_PEAK_2);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(true);
lineSeriesSettings.setSymbolType(PlotSymbolType.CIRCLE);
lineSeriesSettings.setSymbolColor(getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
lineSeriesSettings.setSymbolSize(2);
lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Background 2
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_SELECTED_PEAK_2_BACKGROUND);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(true);
lineSeriesSettings.setSymbolType(PlotSymbolType.NONE);
lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Identified Scans
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_IDENTIFIED_SCANS);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setLineStyle(LineStyle.NONE);
lineSeriesSettings.setSymbolType(PlotSymbolType.CIRCLE);
lineSeriesSettings.setSymbolSize(3);
lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_GRAY));
lineSeriesSettings.setSymbolColor(getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Identified Scans Selected.
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_IDENTIFIED_SCANS_SELECTED);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setLineStyle(LineStyle.NONE);
lineSeriesSettings.setSymbolType(PlotSymbolType.CIRCLE);
lineSeriesSettings.setSymbolSize(5);
lineSeriesSettings.setSymbolColor(getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Set series.
*/
addSeriesData(lineSeriesDataList);
/*
* Set the labels.
*/
IPlotArea plotArea = (IPlotArea) getBaseChart().getPlotArea();
LabelMarker labelMarker = new LabelMarker(getBaseChart());
List<String> labels = new ArrayList<String>();
labels.add("2-Methoxy-4-vinylphenol");
labels.add("Ethanone, 1-(2-hydroxy-5-methylphenyl)-");
labels.add("4-Hydroxy-2-methylacetophenone");
labels.add("Ethanone, 1-(2-hydroxy-5-methylphenyl)-");
labels.add("4-Hydroxy-3-methylacetophenone");
labels.add("3-Methoxyacetophenone");
labels.add("3-Methyl-4-isopropylphenol");
labels.add("Phenol, 3,4-dimethoxy-");
labels.add("2,4-Dimethoxyphenol");
labels.add("3-Amino-2,6-dimethoxypyridine");
labelMarker.setLabels(labels, indexSeries, SWT.VERTICAL);
plotArea.addCustomPaintListener(labelMarker);
}
use of org.eclipse.swtchart.IPlotArea in project swtchart by eclipse.
the class LineSeries_8_Part method initialize.
private void initialize() throws Exception {
/*
* Chart Settings
*/
IChartSettings chartSettings = getChartSettings();
chartSettings.setCreateMenu(true);
applySettings(chartSettings);
/*
* Create series.
*/
List<ILineSeriesData> lineSeriesDataList = new ArrayList<ILineSeriesData>();
//
ISeriesData seriesData;
ILineSeriesData lineSeriesData;
ILineSeriesSettings lineSeriesSettings;
/*
* Chromatogram [0]
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(true);
ILineSeriesSettings lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
/*
* Active Peaks [1]
*/
indexSeries = 1;
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_1_ACTIVE_PEAKS);
lineSeriesData = new LineSeriesData(seriesData);
lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setEnableArea(false);
lineSeriesSettings.setLineStyle(LineStyle.NONE);
lineSeriesSettings.setSymbolType(PlotSymbolType.INVERTED_TRIANGLE);
lineSeriesSettings.setSymbolSize(5);
lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_GRAY));
lineSeriesSettings.setSymbolColor(getDisplay().getSystemColor(SWT.COLOR_GRAY));
lineSeriesDataList.add(lineSeriesData);
/*
* Set series.
*/
addSeriesData(lineSeriesDataList);
/*
* Add the label marker.
*/
IPlotArea plotArea = (IPlotArea) getBaseChart().getPlotArea();
LabelMarker labelMarker = new LabelMarker(getBaseChart());
List<String> labels = new ArrayList<String>();
labels.add("2-Methoxy-4-vinylphenol");
labels.add("Ethanone, 1-(2-hydroxy-5-methylphenyl)-");
labels.add("4-Hydroxy-2-methylacetophenone");
labels.add("Ethanone, 1-(2-hydroxy-5-methylphenyl)-");
labels.add("4-Hydroxy-3-methylacetophenone");
labels.add("3-Methoxyacetophenone");
labels.add("3-Methyl-4-isopropylphenol");
labels.add("Phenol, 3,4-dimethoxy-");
labels.add("2,4-Dimethoxyphenol");
labels.add("3-Amino-2,6-dimethoxypyridine");
labelMarker.setLabels(labels, indexSeries, SWT.VERTICAL);
plotArea.addCustomPaintListener(labelMarker);
}
use of org.eclipse.swtchart.IPlotArea in project swtchart by eclipse.
the class BarSeries_4_Part method initialize.
private void initialize() {
/*
* Chart Settings
*/
IChartSettings chartSettings = getChartSettings();
chartSettings.setCreateMenu(true);
applySettings(chartSettings);
/*
* Bar Series [0]
*/
indexSeries = 0;
List<IBarSeriesData> barSeriesDataList = new ArrayList<IBarSeriesData>();
ISeriesData seriesData = SeriesConverter.getSeriesXY(SeriesConverter.BAR_SERIES_1);
//
IBarSeriesData barSeriesData = new BarSeriesData(seriesData);
barSeriesDataList.add(barSeriesData);
/*
* Set series.
*/
addSeriesData(barSeriesDataList);
/*
* Add the label marker.
*/
IPlotArea plotArea = (IPlotArea) getBaseChart().getPlotArea();
LabelMarker labelMarker = new LabelMarker(getBaseChart());
Map<Integer, String> labels = new HashMap<Integer, String>();
labels.put(21, "2-Methoxy-4-vinylphenol");
labels.put(40, "Ethanone, 1-(2-hydroxy-5-methylphenyl)-");
labels.put(64, "4-Hydroxy-3-methylacetophenone");
//
labelMarker.setLabels(labels, indexSeries, SWT.VERTICAL);
plotArea.addCustomPaintListener(labelMarker);
}
Aggregations