use of org.eclipse.swtchart.extensions.core.ISeriesData in project swtchart by eclipse.
the class BarSeries_2_1_Part method initialize.
private void initialize() {
IChartSettings chartSettings = getChartSettings();
chartSettings.setOrientation(SWT.HORIZONTAL);
chartSettings.setHorizontalSliderVisible(true);
chartSettings.setVerticalSliderVisible(true);
chartSettings.getRangeRestriction().setZeroX(false);
chartSettings.getRangeRestriction().setZeroY(false);
//
IPrimaryAxisSettings primaryAxisSettingsX = chartSettings.getPrimaryAxisSettingsX();
primaryAxisSettingsX.setTitle("m/z");
primaryAxisSettingsX.setDecimalFormat(new DecimalFormat(("0.0##"), new DecimalFormatSymbols(Locale.ENGLISH)));
primaryAxisSettingsX.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
//
IPrimaryAxisSettings primaryAxisSettingsY = chartSettings.getPrimaryAxisSettingsY();
primaryAxisSettingsY.setTitle("Intensity");
primaryAxisSettingsY.setDecimalFormat(new DecimalFormat(("0.0#E0"), new DecimalFormatSymbols(Locale.ENGLISH)));
primaryAxisSettingsY.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
//
applySettings(chartSettings);
/*
* Create series.
*/
List<IBarSeriesData> barSeriesDataList = new ArrayList<IBarSeriesData>();
ISeriesData seriesData = SeriesConverter.getSeriesXY(SeriesConverter.BAR_SERIES_2);
//
IBarSeriesData barSeriesData = new BarSeriesData(seriesData);
barSeriesDataList.add(barSeriesData);
/*
* Set series.
*/
addSeriesData(barSeriesDataList);
}
use of org.eclipse.swtchart.extensions.core.ISeriesData in project swtchart by eclipse.
the class BarSeries_2_2_Part method initialize.
private void initialize() {
IChartSettings chartSettings = getChartSettings();
RangeRestriction rangeRestriction = chartSettings.getRangeRestriction();
rangeRestriction.setExtendTypeX(RangeRestriction.ExtendType.RELATIVE);
rangeRestriction.setExtendMinX(0.0d);
rangeRestriction.setExtendMaxX(0.0d);
rangeRestriction.setExtendTypeY(RangeRestriction.ExtendType.RELATIVE);
rangeRestriction.setExtendMaxY(0.1d);
applySettings(chartSettings);
//
setNumberOfHighestIntensitiesToLabel(5);
setLabelOption(LabelOption.EXACT);
setCustomLabels(null);
/*
* Create series.
*/
List<IBarSeriesData> barSeriesDataList = new ArrayList<IBarSeriesData>();
ISeriesData seriesData = SeriesConverter.getSeriesXY(SeriesConverter.BAR_SERIES_2);
//
IBarSeriesData barSeriesData = new BarSeriesData(seriesData);
barSeriesDataList.add(barSeriesData);
/*
* Set series.
*/
addSeriesData(barSeriesDataList);
}
use of org.eclipse.swtchart.extensions.core.ISeriesData in project swtchart by eclipse.
the class BarSeries_3_Part method initialize.
private void initialize() {
IChartSettings chartSettings = getChartSettings();
RangeRestriction rangeRestriction = chartSettings.getRangeRestriction();
rangeRestriction.setExtendTypeY(RangeRestriction.ExtendType.RELATIVE);
rangeRestriction.setExtendMinY(0.1d);
applySettings(chartSettings);
//
setNumberOfHighestIntensitiesToLabel(5);
setLabelOption(LabelOption.NOMIMAL);
setCustomLabels(null);
/*
* Create series.
*/
List<IBarSeriesData> barSeriesDataList = new ArrayList<IBarSeriesData>();
ISeriesData seriesData;
IBarSeriesData barSeriesData;
IBarSeriesSettings barSeriesSettings;
/*
* Positive
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.BAR_SERIES_3_POSITIVE);
barSeriesData = new BarSeriesData(seriesData);
barSeriesSettings = barSeriesData.getBarSeriesSettings();
barSeriesSettings.setBarColor(getDisplay().getSystemColor(SWT.COLOR_RED));
barSeriesDataList.add(barSeriesData);
/*
* Negative
*/
seriesData = SeriesConverter.getSeriesXY(SeriesConverter.BAR_SERIES_3_NEGATIVE);
barSeriesData = new BarSeriesData(seriesData);
barSeriesSettings = barSeriesData.getBarSeriesSettings();
barSeriesSettings.setBarColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
barSeriesDataList.add(barSeriesData);
/*
* Set series.
*/
addSeriesData(barSeriesDataList);
}
use of org.eclipse.swtchart.extensions.core.ISeriesData 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