use of org.eclipse.swtchart.extensions.core.IChartSettings 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.IChartSettings 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.IChartSettings 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);
}
use of org.eclipse.swtchart.extensions.core.IChartSettings in project swtchart by eclipse.
the class MassSpectrumChart method initialize.
private void initialize() {
numberOfHighestIntensitiesToLabel = 5;
barSeriesIonComparator = new BarSeriesIonComparator();
labelOption = LabelOption.EXACT;
customLabels = new HashMap<Double, String>();
//
IChartSettings chartSettings = getChartSettings();
chartSettings.setOrientation(SWT.HORIZONTAL);
chartSettings.setHorizontalSliderVisible(true);
chartSettings.setVerticalSliderVisible(true);
RangeRestriction rangeRestriction = chartSettings.getRangeRestriction();
rangeRestriction.setZeroX(false);
rangeRestriction.setZeroY(false);
rangeRestriction.setRestrictZoom(true);
rangeRestriction.setExtendTypeX(RangeRestriction.ExtendType.ABSOLUTE);
rangeRestriction.setExtendMinX(2.0d);
rangeRestriction.setExtendMaxX(2.0d);
rangeRestriction.setExtendTypeY(RangeRestriction.ExtendType.RELATIVE);
rangeRestriction.setExtendMaxY(0.1d);
//
setPrimaryAxisSet(chartSettings);
addSecondaryAxisSet(chartSettings);
applySettings(chartSettings);
//
addSeriesLabelMarker();
}
use of org.eclipse.swtchart.extensions.core.IChartSettings in project swtchart by eclipse.
the class PCAChart method setTitles.
public void setTitles(String chartTitle, String xAxisTitle, String yAxisTitle) {
this.chartTitle = chartTitle;
this.xAxisTitle = xAxisTitle;
this.yAxisTitle = yAxisTitle;
//
IChartSettings chartSettings = getChartSettings();
chartSettings.setTitle(chartTitle);
chartSettings.getPrimaryAxisSettingsX().setTitle(xAxisTitle);
chartSettings.getPrimaryAxisSettingsY().setTitle(yAxisTitle);
applySettings(chartSettings);
}
Aggregations