Search in sources :

Example 1 with LabelMarker

use of org.eclipse.swtchart.extensions.marker.LabelMarker in project swtchart by eclipse.

the class LineSeries_9_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.HORIZONTAL);
    plotArea.addCustomPaintListener(labelMarker);
}
Also used : ILineSeriesSettings(org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings) LineSeriesData(org.eclipse.swtchart.extensions.linecharts.LineSeriesData) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) ArrayList(java.util.ArrayList) IPlotArea(org.eclipse.swtchart.IPlotArea) LabelMarker(org.eclipse.swtchart.extensions.marker.LabelMarker)

Example 2 with LabelMarker

use of org.eclipse.swtchart.extensions.marker.LabelMarker 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);
}
Also used : ILineSeriesSettings(org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings) LineSeriesData(org.eclipse.swtchart.extensions.linecharts.LineSeriesData) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) ArrayList(java.util.ArrayList) IPlotArea(org.eclipse.swtchart.IPlotArea) LabelMarker(org.eclipse.swtchart.extensions.marker.LabelMarker)

Example 3 with LabelMarker

use of org.eclipse.swtchart.extensions.marker.LabelMarker 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);
}
Also used : ILineSeriesSettings(org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings) LineSeriesData(org.eclipse.swtchart.extensions.linecharts.LineSeriesData) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) ArrayList(java.util.ArrayList) IPlotArea(org.eclipse.swtchart.IPlotArea) LabelMarker(org.eclipse.swtchart.extensions.marker.LabelMarker)

Example 4 with LabelMarker

use of org.eclipse.swtchart.extensions.marker.LabelMarker 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);
}
Also used : ILineSeriesSettings(org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings) LineSeriesData(org.eclipse.swtchart.extensions.linecharts.LineSeriesData) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) ArrayList(java.util.ArrayList) IPlotArea(org.eclipse.swtchart.IPlotArea) LabelMarker(org.eclipse.swtchart.extensions.marker.LabelMarker)

Example 5 with LabelMarker

use of org.eclipse.swtchart.extensions.marker.LabelMarker 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);
}
Also used : ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) IBarSeriesData(org.eclipse.swtchart.extensions.barcharts.IBarSeriesData) IBarSeriesData(org.eclipse.swtchart.extensions.barcharts.IBarSeriesData) BarSeriesData(org.eclipse.swtchart.extensions.barcharts.BarSeriesData) HashMap(java.util.HashMap) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) ArrayList(java.util.ArrayList) IPlotArea(org.eclipse.swtchart.IPlotArea) LabelMarker(org.eclipse.swtchart.extensions.marker.LabelMarker)

Aggregations

ArrayList (java.util.ArrayList)5 IPlotArea (org.eclipse.swtchart.IPlotArea)5 IChartSettings (org.eclipse.swtchart.extensions.core.IChartSettings)5 ISeriesData (org.eclipse.swtchart.extensions.core.ISeriesData)5 LabelMarker (org.eclipse.swtchart.extensions.marker.LabelMarker)5 ILineSeriesData (org.eclipse.swtchart.extensions.linecharts.ILineSeriesData)4 ILineSeriesSettings (org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings)4 LineSeriesData (org.eclipse.swtchart.extensions.linecharts.LineSeriesData)4 HashMap (java.util.HashMap)1 BarSeriesData (org.eclipse.swtchart.extensions.barcharts.BarSeriesData)1 IBarSeriesData (org.eclipse.swtchart.extensions.barcharts.IBarSeriesData)1