use of org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings in project swtchart by eclipse.
the class LineSeries_Edit_Part method loadChromatogramData.
private void loadChromatogramData() {
chromatogramChart.deleteSeries();
//
Map<Integer, Color> colors = new HashMap<Integer, Color>();
colors.put(1, getDisplay().getSystemColor(SWT.COLOR_RED));
colors.put(2, getDisplay().getSystemColor(SWT.COLOR_BLACK));
colors.put(3, getDisplay().getSystemColor(SWT.COLOR_GRAY));
colors.put(4, getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
colors.put(5, getDisplay().getSystemColor(SWT.COLOR_GRAY));
//
String[] items = new String[6];
items[0] = "No Selection";
//
List<ILineSeriesData> lineSeriesDataList = new ArrayList<ILineSeriesData>();
for (int i = 1; i <= NUM_SERIES; i++) {
ISeriesData seriesData = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES + "4_" + i);
items[i] = seriesData.getId();
ILineSeriesData lineSeriesData = new LineSeriesData(seriesData);
ILineSeriesSettings lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
lineSeriesSettings.setLineColor(colors.get(i));
lineSeriesSettings.setEnableArea(false);
ILineSeriesSettings lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
lineSeriesSettingsHighlight.setLineWidth(2);
lineSeriesDataList.add(lineSeriesData);
}
//
chromatogramChart.addSeriesData(lineSeriesDataList, LineChart.MEDIUM_COMPRESSION);
comboSelectSeries.setItems(items);
// LineSeries4_1
comboSelectSeries.select(1);
selectSeries();
//
setComboAxisItems();
}
Aggregations