Search in sources :

Example 1 with RelativeIntensityConverter

use of org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter in project swtchart by eclipse.

the class MassSpectrumChart method addSecondaryAxisSet.

private void addSecondaryAxisSet(IChartSettings chartSettings) {
    ISecondaryAxisSettings secondaryAxisSettingsY = new SecondaryAxisSettings("Relative Intensity [%]", new RelativeIntensityConverter(SWT.VERTICAL, true));
    secondaryAxisSettingsY.setPosition(Position.Secondary);
    secondaryAxisSettingsY.setDecimalFormat(new DecimalFormat(("0.00"), new DecimalFormatSymbols(Locale.ENGLISH)));
    secondaryAxisSettingsY.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
    chartSettings.getSecondaryAxisSettingsListY().add(secondaryAxisSettingsY);
}
Also used : ISecondaryAxisSettings(org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings) RelativeIntensityConverter(org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter) ISecondaryAxisSettings(org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings) SecondaryAxisSettings(org.eclipse.swtchart.extensions.core.SecondaryAxisSettings) DecimalFormatSymbols(java.text.DecimalFormatSymbols) DecimalFormat(java.text.DecimalFormat)

Example 2 with RelativeIntensityConverter

use of org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter in project swtchart by eclipse.

the class BarSeries_Preferences_Part method applyChartSettings.

private void applyChartSettings() throws Exception {
    IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
    setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
    // 
    Color colorHintRangeSelector = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_COLOR_HINT_RANGE_SELECTOR));
    Color colorTitle = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_TITLE_COLOR));
    Color colorBackground = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_BACKGROUND));
    Color colorBackgroundChart = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_BACKGROUND_CHART));
    Color colorBackgroundPlotArea = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_BACKGROUND_PLOT_AREA));
    Color colorPrimaryXAxis = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_PRIMARY_X_AXIS_COLOR));
    Color colorPrimaryYAxis = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_PRIMARY_Y_AXIS_COLOR));
    Color colorSecondaryYAxis = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_SECONDARY_Y_AXIS_COLOR));
    Locale localePrimaryXAxis = new Locale(preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_X_AXIS_DECIMAL_FORMAT_LOCALE));
    Locale localePrimaryYAxis = new Locale(preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_Y_AXIS_DECIMAL_FORMAT_LOCALE));
    Locale localeSecondaryYAxis = new Locale(preferenceStore.getString(BarSeriesPreferenceConstants.P_SECONDARY_Y_AXIS_DECIMAL_FORMAT_LOCALE));
    Color colorPositionMarker = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_COLOR_POSITION_MARKER));
    Color colorPlotCenterMarker = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_COLOR_PLOT_CENTER_MARKER));
    Color colorLegendMarker = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_COLOR_LEGEND_MARKER));
    Color colorAxisZeroMarker = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_COLOR_AXIS_ZERO_MARKER));
    Color colorSeriesLabelMarker = getColor(PreferenceConverter.getColor(preferenceStore, BarSeriesPreferenceConstants.P_COLOR_SERIES_LABEL_MARKER));
    // 
    IChartSettings chartSettings = barChart.getChartSettings();
    chartSettings.setEnableRangeSelector(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_ENABLE_RANGE_SELECTOR));
    chartSettings.setShowRangeSelectorInitially(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_SHOW_RANGE_SELECTOR_INITIALLY));
    chartSettings.setColorHintRangeSelector(colorHintRangeSelector);
    chartSettings.setRangeSelectorDefaultAxisX(preferenceStore.getInt(BarSeriesPreferenceConstants.P_RANGE_SELECTOR_DEFAULT_AXIS_X));
    chartSettings.setRangeSelectorDefaultAxisY(preferenceStore.getInt(BarSeriesPreferenceConstants.P_RANGE_SELECTOR_DEFAULT_AXIS_Y));
    chartSettings.setVerticalSliderVisible(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_VERTICAL_SLIDER_VISIBLE));
    chartSettings.setHorizontalSliderVisible(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_HORIZONTAL_SLIDER_VISIBLE));
    chartSettings.setTitle(preferenceStore.getString(BarSeriesPreferenceConstants.P_TITLE));
    chartSettings.setTitleVisible(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_TITLE_VISIBLE));
    chartSettings.setTitleColor(colorTitle);
    chartSettings.setLegendPosition(preferenceStore.getInt(BarSeriesPreferenceConstants.P_LEGEND_POSITION));
    chartSettings.setLegendVisible(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_LEGEND_VISIBLE));
    chartSettings.setOrientation(preferenceStore.getInt(BarSeriesPreferenceConstants.P_ORIENTATION));
    chartSettings.setBackground(colorBackground);
    chartSettings.setBackgroundChart(colorBackgroundChart);
    chartSettings.setBackgroundPlotArea(colorBackgroundPlotArea);
    chartSettings.setEnableCompress(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_ENABLE_COMPRESS));
    RangeRestriction rangeRestriction = chartSettings.getRangeRestriction();
    rangeRestriction.setZeroX(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_ZERO_X));
    rangeRestriction.setZeroY(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_ZERO_Y));
    rangeRestriction.setRestrictZoom(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_RESTRICT_ZOOM));
    rangeRestriction.setXZoomOnly(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_X_ZOOM_ONLY));
    rangeRestriction.setYZoomOnly(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_Y_ZOOM_ONLY));
    rangeRestriction.setForceZeroMinY(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_FORCE_ZERO_MIN_Y));
    rangeRestriction.setExtendTypeX(RangeRestriction.ExtendType.valueOf(preferenceStore.getString(BarSeriesPreferenceConstants.P_EXTEND_TYPE_X)));
    rangeRestriction.setExtendMinX(preferenceStore.getDouble(BarSeriesPreferenceConstants.P_EXTEND_MIN_X));
    rangeRestriction.setExtendMaxX(preferenceStore.getDouble(BarSeriesPreferenceConstants.P_EXTEND_MAX_X));
    rangeRestriction.setExtendTypeY(RangeRestriction.ExtendType.valueOf(preferenceStore.getString(BarSeriesPreferenceConstants.P_EXTEND_TYPE_Y)));
    rangeRestriction.setExtendMinY(preferenceStore.getDouble(BarSeriesPreferenceConstants.P_EXTEND_MIN_Y));
    rangeRestriction.setExtendMaxY(preferenceStore.getDouble(BarSeriesPreferenceConstants.P_EXTEND_MAX_Y));
    // 
    chartSettings.setShowPositionMarker(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_SHOW_POSITION_MARKER));
    chartSettings.setColorPositionMarker(colorPositionMarker);
    chartSettings.setShowPlotCenterMarker(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_SHOW_PLOT_CENTER_MARKER));
    chartSettings.setColorPlotCenterMarker(colorPlotCenterMarker);
    chartSettings.setShowLegendMarker(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_SHOW_LEGEND_MARKER));
    chartSettings.setColorLegendMarker(colorLegendMarker);
    chartSettings.setShowAxisZeroMarker(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_SHOW_AXIS_ZERO_MARKER));
    chartSettings.setColorLegendMarker(colorAxisZeroMarker);
    chartSettings.setShowSeriesLabelMarker(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_SHOW_SERIES_LABEL_MARKER));
    chartSettings.setColorSeriesLabelMarker(colorSeriesLabelMarker);
    // 
    chartSettings.setCreateMenu(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_CREATE_MENU));
    /*
		 * Primary X-Axis
		 */
    IPrimaryAxisSettings primaryAxisSettingsX = chartSettings.getPrimaryAxisSettingsX();
    primaryAxisSettingsX.setTitle(preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_X_AXIS_TITLE));
    primaryAxisSettingsX.setDescription(preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_X_AXIS_DESCRIPTION));
    primaryAxisSettingsX.setDecimalFormat(new DecimalFormat((preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_X_AXIS_DECIMAL_FORMAT_PATTERN)), new DecimalFormatSymbols(localePrimaryXAxis)));
    primaryAxisSettingsX.setColor(colorPrimaryXAxis);
    primaryAxisSettingsX.setPosition(Position.valueOf(preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_X_AXIS_POSITION)));
    primaryAxisSettingsX.setVisible(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_PRIMARY_X_AXIS_VISIBLE));
    primaryAxisSettingsX.setGridLineStyle(LineStyle.valueOf(preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_X_AXIS_GRID_LINE_STYLE)));
    primaryAxisSettingsX.setEnableLogScale(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_PRIMARY_X_AXIS_ENABLE_LOG_SCALE));
    primaryAxisSettingsX.setExtraSpaceTitle(preferenceStore.getInt(BarSeriesPreferenceConstants.P_PRIMARY_X_AXIS_EXTRA_SPACE_TITLE));
    /*
		 * Primary Y-Axis
		 */
    IPrimaryAxisSettings primaryAxisSettingsY = chartSettings.getPrimaryAxisSettingsY();
    primaryAxisSettingsY.setTitle(preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_Y_AXIS_TITLE));
    primaryAxisSettingsY.setDescription(preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_Y_AXIS_DESCRIPTION));
    primaryAxisSettingsY.setDecimalFormat(new DecimalFormat((preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_Y_AXIS_DECIMAL_FORMAT_PATTERN)), new DecimalFormatSymbols(localePrimaryYAxis)));
    primaryAxisSettingsY.setColor(colorPrimaryYAxis);
    primaryAxisSettingsY.setPosition(Position.valueOf(preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_Y_AXIS_POSITION)));
    primaryAxisSettingsY.setVisible(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_PRIMARY_Y_AXIS_VISIBLE));
    primaryAxisSettingsY.setGridLineStyle(LineStyle.valueOf(preferenceStore.getString(BarSeriesPreferenceConstants.P_PRIMARY_Y_AXIS_GRID_LINE_STYLE)));
    primaryAxisSettingsY.setEnableLogScale(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_PRIMARY_Y_AXIS_ENABLE_LOG_SCALE));
    primaryAxisSettingsY.setExtraSpaceTitle(preferenceStore.getInt(BarSeriesPreferenceConstants.P_PRIMARY_Y_AXIS_EXTRA_SPACE_TITLE));
    /*
		 * Secondary Y-Axes
		 */
    chartSettings.getSecondaryAxisSettingsListY().clear();
    ISecondaryAxisSettings secondaryAxisSettingsY = new SecondaryAxisSettings(preferenceStore.getString(BarSeriesPreferenceConstants.P_SECONDARY_Y_AXIS_TITLE), new RelativeIntensityConverter(SWT.VERTICAL, true));
    secondaryAxisSettingsY.setDescription(preferenceStore.getString(BarSeriesPreferenceConstants.P_SECONDARY_Y_AXIS_DESCRIPTION));
    secondaryAxisSettingsY.setDecimalFormat(new DecimalFormat((preferenceStore.getString(BarSeriesPreferenceConstants.P_SECONDARY_Y_AXIS_DECIMAL_FORMAT_PATTERN)), new DecimalFormatSymbols(localeSecondaryYAxis)));
    secondaryAxisSettingsY.setColor(colorSecondaryYAxis);
    secondaryAxisSettingsY.setPosition(Position.valueOf(preferenceStore.getString(BarSeriesPreferenceConstants.P_SECONDARY_Y_AXIS_POSITION)));
    secondaryAxisSettingsY.setVisible(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_SECONDARY_Y_AXIS_VISIBLE));
    secondaryAxisSettingsY.setGridLineStyle(LineStyle.valueOf(preferenceStore.getString(BarSeriesPreferenceConstants.P_SECONDARY_Y_AXIS_GRID_LINE_STYLE)));
    secondaryAxisSettingsY.setEnableLogScale(preferenceStore.getBoolean(BarSeriesPreferenceConstants.P_SECONDARY_Y_AXIS_ENABLE_LOG_SCALE));
    secondaryAxisSettingsY.setExtraSpaceTitle(preferenceStore.getInt(BarSeriesPreferenceConstants.P_SECONDARY_Y_AXIS_EXTRA_SPACE_TITLE));
    chartSettings.getSecondaryAxisSettingsListY().add(secondaryAxisSettingsY);
    // 
    barChart.applySettings(chartSettings);
}
Also used : Locale(java.util.Locale) ISecondaryAxisSettings(org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings) RelativeIntensityConverter(org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter) DecimalFormatSymbols(java.text.DecimalFormatSymbols) ISecondaryAxisSettings(org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings) SecondaryAxisSettings(org.eclipse.swtchart.extensions.core.SecondaryAxisSettings) Color(org.eclipse.swt.graphics.Color) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) DecimalFormat(java.text.DecimalFormat) RangeRestriction(org.eclipse.swtchart.extensions.core.RangeRestriction) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) IPrimaryAxisSettings(org.eclipse.swtchart.extensions.core.IPrimaryAxisSettings)

Example 3 with RelativeIntensityConverter

use of org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter in project swtchart by eclipse.

the class LineSeries_Selection_Part method applyChartSettings.

private void applyChartSettings() throws Exception {
    /*
		 * Chart Settings
		 */
    IChartSettings chartSettings = lineChart.getChartSettings();
    chartSettings.setCreateMenu(true);
    /*
		 * Primary X-Axis
		 */
    IPrimaryAxisSettings primaryAxisSettingsX = chartSettings.getPrimaryAxisSettingsX();
    primaryAxisSettingsX.setTitle("Retention Time (milliseconds)");
    primaryAxisSettingsX.setDecimalFormat(new DecimalFormat(("0.0##"), new DecimalFormatSymbols(Locale.ENGLISH)));
    primaryAxisSettingsX.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
    /*
		 * Primary Y-Axis
		 */
    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));
    primaryAxisSettingsY.setGridLineStyle(LineStyle.NONE);
    /*
		 * Secondary Y-Axes
		 */
    ISecondaryAxisSettings secondaryAxisSettingsY1 = new SecondaryAxisSettings("Relative Intensity [%]", new RelativeIntensityConverter(SWT.VERTICAL, true));
    secondaryAxisSettingsY1.setPosition(Position.Secondary);
    secondaryAxisSettingsY1.setDecimalFormat(new DecimalFormat(("0.00"), new DecimalFormatSymbols(Locale.ENGLISH)));
    secondaryAxisSettingsY1.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
    chartSettings.getSecondaryAxisSettingsListY().add(secondaryAxisSettingsY1);
    // 
    lineChart.applySettings(chartSettings);
    /*
		 * Create series.
		 */
    List<ILineSeriesData> lineSeriesDataList = new ArrayList<ILineSeriesData>();
    ISeriesData seriesDataLine = SeriesConverter.getSeriesXY(SeriesConverter.LINE_SERIES_3);
    double[] xSeries = seriesDataLine.getXSeries();
    double[] ySeries = seriesDataLine.getYSeries();
    xValues = new TreeSet<Double>();
    yValues = new HashMap<Double, Double>();
    for (int i = 0; i < xSeries.length; i++) {
        double x = xSeries[i];
        xValues.add(x);
        yValues.put(x, ySeries[i]);
    }
    /*
		 * Line Series
		 */
    ILineSeriesData lineSeriesData;
    ILineSeriesSettings lineSeriesSettings;
    // 
    lineSeriesData = new LineSeriesData(seriesDataLine);
    lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
    lineSeriesSettings.setEnableArea(true);
    ILineSeriesSettings lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
    lineSeriesSettingsHighlight.setLineWidth(2);
    lineSeriesDataList.add(lineSeriesData);
    /*
		 * Selected Point
		 */
    seriesDataPoint = new SeriesData(new double[] { 0.0 }, new double[] { 0.0 }, DATA_POINT_SERIES);
    lineSeriesData = new LineSeriesData(seriesDataPoint);
    lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
    lineSeriesSettings.setSymbolSize(5);
    lineSeriesSettings.setSymbolType(PlotSymbolType.CROSS);
    lineSeriesSettings.setEnableArea(true);
    lineSeriesDataList.add(lineSeriesData);
    /*
		 * Set series.
		 */
    lineChart.addSeriesData(lineSeriesDataList);
}
Also used : ISecondaryAxisSettings(org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings) RelativeIntensityConverter(org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) LineSeriesData(org.eclipse.swtchart.extensions.linecharts.LineSeriesData) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) DecimalFormatSymbols(java.text.DecimalFormatSymbols) DecimalFormat(java.text.DecimalFormat) ArrayList(java.util.ArrayList) ILineSeriesSettings(org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) LineSeriesData(org.eclipse.swtchart.extensions.linecharts.LineSeriesData) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) SeriesData(org.eclipse.swtchart.extensions.core.SeriesData) ISecondaryAxisSettings(org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings) SecondaryAxisSettings(org.eclipse.swtchart.extensions.core.SecondaryAxisSettings) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) IPrimaryAxisSettings(org.eclipse.swtchart.extensions.core.IPrimaryAxisSettings)

Example 4 with RelativeIntensityConverter

use of org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter in project swtchart by eclipse.

the class RelativeIntensityConverter_1_Test method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    relativeIntensityConverter = new RelativeIntensityConverter(SWT.VERTICAL, true);
    relativeIntensityConverter.setChartDataCoordinates(new TestChartDataCoordinates());
}
Also used : RelativeIntensityConverter(org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter)

Example 5 with RelativeIntensityConverter

use of org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter in project swtchart by eclipse.

the class CustomLineChart1 method configureChart.

private void configureChart() {
    try {
        IChartSettings chartSettings = getChartSettings();
        chartSettings.setOrientation(SWT.HORIZONTAL);
        chartSettings.setEnableRangeSelector(enableRangeSelector);
        chartSettings.setHorizontalSliderVisible(enableHorizontalSlider);
        chartSettings.setVerticalSliderVisible(false);
        chartSettings.getRangeRestriction().setZeroX(true);
        chartSettings.getRangeRestriction().setZeroY(true);
        // 
        IPrimaryAxisSettings primaryAxisSettingsX = chartSettings.getPrimaryAxisSettingsX();
        primaryAxisSettingsX.setTitle("Retention Time (milliseconds)");
        primaryAxisSettingsX.setDecimalFormat(new DecimalFormat(("0.0##"), new DecimalFormatSymbols(Locale.ENGLISH)));
        primaryAxisSettingsX.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
        primaryAxisSettingsX.setPosition(Position.Secondary);
        primaryAxisSettingsX.setVisible(false);
        primaryAxisSettingsX.setGridLineStyle(LineStyle.NONE);
        // 
        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));
        primaryAxisSettingsY.setPosition(Position.Primary);
        primaryAxisSettingsY.setVisible(true);
        primaryAxisSettingsY.setGridLineStyle(LineStyle.NONE);
        /*
			 * Secondary X-Axes
			 */
        String axisTitle = (showAxisTitle) ? "Minutes" : "";
        ISecondaryAxisSettings secondaryAxisSettingsX1 = new SecondaryAxisSettings(axisTitle, "Minutes", new MillisecondsToMinuteConverter());
        secondaryAxisSettingsX1.setPosition(Position.Primary);
        secondaryAxisSettingsX1.setDecimalFormat(new DecimalFormat(("0.00"), new DecimalFormatSymbols(Locale.ENGLISH)));
        secondaryAxisSettingsX1.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
        chartSettings.getSecondaryAxisSettingsListX().add(secondaryAxisSettingsX1);
        /*
			 * Secondary Y-Axes
			 */
        ISecondaryAxisSettings secondaryAxisSettingsY1 = new SecondaryAxisSettings("Relative Intensity [%]", new RelativeIntensityConverter(SWT.VERTICAL, true));
        secondaryAxisSettingsY1.setPosition(Position.Secondary);
        secondaryAxisSettingsY1.setDecimalFormat(new DecimalFormat(("0.00"), new DecimalFormatSymbols(Locale.ENGLISH)));
        secondaryAxisSettingsY1.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
        chartSettings.getSecondaryAxisSettingsListY().add(secondaryAxisSettingsY1);
        // 
        applySettings(chartSettings);
    } catch (Exception e) {
        System.out.println(e);
    }
}
Also used : ISecondaryAxisSettings(org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings) RelativeIntensityConverter(org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter) DecimalFormatSymbols(java.text.DecimalFormatSymbols) SecondaryAxisSettings(org.eclipse.swtchart.extensions.core.SecondaryAxisSettings) ISecondaryAxisSettings(org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) DecimalFormat(java.text.DecimalFormat) MillisecondsToMinuteConverter(org.eclipse.swtchart.extensions.axisconverter.MillisecondsToMinuteConverter) IPrimaryAxisSettings(org.eclipse.swtchart.extensions.core.IPrimaryAxisSettings)

Aggregations

RelativeIntensityConverter (org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter)9 DecimalFormat (java.text.DecimalFormat)7 DecimalFormatSymbols (java.text.DecimalFormatSymbols)7 ISecondaryAxisSettings (org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings)7 SecondaryAxisSettings (org.eclipse.swtchart.extensions.core.SecondaryAxisSettings)7 IChartSettings (org.eclipse.swtchart.extensions.core.IChartSettings)5 IPrimaryAxisSettings (org.eclipse.swtchart.extensions.core.IPrimaryAxisSettings)5 MillisecondsToMinuteConverter (org.eclipse.swtchart.extensions.axisconverter.MillisecondsToMinuteConverter)4 ArrayList (java.util.ArrayList)2 Locale (java.util.Locale)2 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)2 Color (org.eclipse.swt.graphics.Color)2 ISeriesData (org.eclipse.swtchart.extensions.core.ISeriesData)2 RangeRestriction (org.eclipse.swtchart.extensions.core.RangeRestriction)2 ILineSeriesData (org.eclipse.swtchart.extensions.linecharts.ILineSeriesData)2 ILineSeriesSettings (org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings)2 LineSeriesData (org.eclipse.swtchart.extensions.linecharts.LineSeriesData)2 MillisecondsToScanNumberConverter (org.eclipse.swtchart.extensions.axisconverter.MillisecondsToScanNumberConverter)1 SeriesData (org.eclipse.swtchart.extensions.core.SeriesData)1 ZoomInHandler (org.eclipse.swtchart.extensions.examples.menu.ZoomInHandler)1