Search in sources :

Example 6 with IChartSettings

use of org.eclipse.swtchart.extensions.core.IChartSettings in project swtchart by eclipse.

the class MeasurementSeries_3_Part method initialize.

private void initialize() throws Exception {
    /*
		 * Chart Settings
		 */
    IChartSettings chartSettings = getChartSettings();
    chartSettings.setOrientation(SWT.HORIZONTAL);
    chartSettings.setHorizontalSliderVisible(true);
    chartSettings.setVerticalSliderVisible(false);
    chartSettings.getRangeRestriction().setZeroX(true);
    chartSettings.getRangeRestriction().setZeroY(true);
    chartSettings.setCreateMenu(true);
    /*
		 * Primary X-Axis
		 */
    IPrimaryAxisSettings primaryAxisSettingsX = chartSettings.getPrimaryAxisSettingsX();
    primaryAxisSettingsX.setTitle("Concentration [mg/g]");
    primaryAxisSettingsX.setDecimalFormat(new DecimalFormat(("0.00"), new DecimalFormatSymbols(Locale.ENGLISH)));
    primaryAxisSettingsX.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
    primaryAxisSettingsX.setGridLineStyle(LineStyle.DOT);
    /*
		 * Primary Y-Axis
		 */
    IPrimaryAxisSettings primaryAxisSettingsY = chartSettings.getPrimaryAxisSettingsY();
    primaryAxisSettingsY.setTitle("Area");
    primaryAxisSettingsY.setDecimalFormat(new DecimalFormat(("0.00"), new DecimalFormatSymbols(Locale.ENGLISH)));
    primaryAxisSettingsY.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
    primaryAxisSettingsY.setGridLineStyle(LineStyle.DOT);
    // 
    applySettings(chartSettings);
    /*
		 * Create series.
		 */
    List<ILineSeriesData> lineSeriesDataList = new ArrayList<ILineSeriesData>();
    ISeriesData seriesData;
    ILineSeriesData lineSeriesData;
    ILineSeriesSettings lineSeriesSettings;
    ILineSeriesSettings lineSeriesSettingsHighlight;
    /*
		 * Readings
		 */
    seriesData = SeriesConverter.getSeriesXY(SeriesConverter.MEASUREMENT_SERIES_3_READINGS);
    lineSeriesData = new LineSeriesData(seriesData);
    lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
    lineSeriesSettings.setEnableArea(false);
    lineSeriesSettings.setLineStyle(LineStyle.NONE);
    lineSeriesSettings.setSymbolSize(5);
    lineSeriesSettings.setSymbolColor(getDisplay().getSystemColor(SWT.COLOR_RED));
    lineSeriesSettings.setSymbolType(PlotSymbolType.CIRCLE);
    lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
    lineSeriesSettingsHighlight.setLineWidth(2);
    lineSeriesDataList.add(lineSeriesData);
    /*
		 * Regression
		 */
    seriesData = SeriesConverter.getSeriesXY(SeriesConverter.MEASUREMENT_SERIES_3_REGRESSION);
    lineSeriesData = new LineSeriesData(seriesData);
    lineSeriesSettings = lineSeriesData.getLineSeriesSettings();
    lineSeriesSettings.setEnableArea(false);
    lineSeriesSettings.setLineStyle(LineStyle.SOLID);
    lineSeriesSettings.setLineColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
    lineSeriesSettings.setSymbolType(PlotSymbolType.NONE);
    lineSeriesSettingsHighlight = (ILineSeriesSettings) lineSeriesSettings.getSeriesSettingsHighlight();
    lineSeriesSettingsHighlight.setLineWidth(2);
    lineSeriesDataList.add(lineSeriesData);
    /*
		 * Set series.
		 */
    addSeriesData(lineSeriesDataList);
}
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) DecimalFormatSymbols(java.text.DecimalFormatSymbols) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) DecimalFormat(java.text.DecimalFormat) ArrayList(java.util.ArrayList) IPrimaryAxisSettings(org.eclipse.swtchart.extensions.core.IPrimaryAxisSettings)

Example 7 with IChartSettings

use of org.eclipse.swtchart.extensions.core.IChartSettings in project swtchart by eclipse.

the class ScatterSeries_1_Part method initialize.

private void initialize() {
    /*
		 * Chart Settings
		 */
    IChartSettings chartSettings = getChartSettings();
    chartSettings.setCreateMenu(true);
    applySettings(chartSettings);
    /*
		 * Data
		 */
    List<ISeriesData> scatterSeriesList = SeriesConverter.getSeriesScatter(SeriesConverter.SCATTER_SERIES_1);
    List<IScatterSeriesData> scatterSeriesDataList = new ArrayList<IScatterSeriesData>();
    // 
    for (ISeriesData seriesData : scatterSeriesList) {
        IScatterSeriesData scatterSeriesData = new ScatterSeriesData(seriesData);
        IScatterSeriesSettings scatterSeriesSettings = scatterSeriesData.getScatterSeriesSettings();
        /*
			 * Set the color and symbol type.
			 */
        double x = seriesData.getXSeries()[0];
        double y = seriesData.getYSeries()[0];
        applySettings(scatterSeriesSettings, x, y, SYMBOL_SIZE);
        scatterSeriesDataList.add(scatterSeriesData);
    }
    /*
		 * Set series.
		 */
    addSeriesData(scatterSeriesDataList);
}
Also used : IScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesData) IScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesData) ScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.ScatterSeriesData) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) IScatterSeriesSettings(org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesSettings) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) ArrayList(java.util.ArrayList)

Example 8 with IChartSettings

use of org.eclipse.swtchart.extensions.core.IChartSettings in project swtchart by eclipse.

the class ScatterSeries_3_Part method initialize.

private void initialize() throws Exception {
    /*
		 * Chart Settings
		 */
    IChartSettings chartSettings = getChartSettings();
    RangeRestriction rangeRestriction = chartSettings.getRangeRestriction();
    rangeRestriction.setExtendTypeX(RangeRestriction.ExtendType.RELATIVE);
    rangeRestriction.setExtendMinX(0.25d);
    rangeRestriction.setExtendMaxX(0.1d);
    rangeRestriction.setExtendTypeY(RangeRestriction.ExtendType.RELATIVE);
    rangeRestriction.setExtendMinY(0.25d);
    rangeRestriction.setExtendMaxY(0.1d);
    rangeRestriction.setRestrictZoom(false);
    chartSettings.setCreateMenu(true);
    // 
    IPrimaryAxisSettings primaryAxisSettingsX = chartSettings.getPrimaryAxisSettingsX();
    primaryAxisSettingsX.setTitle("1st Dimension");
    primaryAxisSettingsX.setDecimalFormat(new DecimalFormat(("0"), new DecimalFormatSymbols(Locale.ENGLISH)));
    primaryAxisSettingsX.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
    // 
    IPrimaryAxisSettings primaryAxisSettingsY = chartSettings.getPrimaryAxisSettingsY();
    primaryAxisSettingsY.setTitle("2nd Dimension");
    primaryAxisSettingsY.setDecimalFormat(new DecimalFormat(("0.000"), new DecimalFormatSymbols(Locale.ENGLISH)));
    primaryAxisSettingsY.setColor(getDisplay().getSystemColor(SWT.COLOR_BLACK));
    // 
    applySettings(chartSettings);
    /*
		 * Create series.
		 */
    Map<Integer, Color> colors = new HashMap<Integer, Color>();
    colors.put(1, getDisplay().getSystemColor(SWT.COLOR_RED));
    colors.put(2, getDisplay().getSystemColor(SWT.COLOR_GRAY));
    colors.put(3, getDisplay().getSystemColor(SWT.COLOR_GREEN));
    colors.put(4, getDisplay().getSystemColor(SWT.COLOR_YELLOW));
    colors.put(5, getDisplay().getSystemColor(SWT.COLOR_CYAN));
    colors.put(6, getDisplay().getSystemColor(SWT.COLOR_BLUE));
    colors.put(7, getDisplay().getSystemColor(SWT.COLOR_BLACK));
    colors.put(8, getDisplay().getSystemColor(SWT.COLOR_DARK_MAGENTA));
    colors.put(9, getDisplay().getSystemColor(SWT.COLOR_DARK_CYAN));
    colors.put(10, getDisplay().getSystemColor(SWT.COLOR_DARK_GREEN));
    colors.put(11, getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
    // 
    List<IScatterSeriesData> scatterSeriesDataList = new ArrayList<IScatterSeriesData>();
    for (int i = 1; i <= 5; i++) {
        for (int j = 1; j <= 20; j++) {
            String id = "Series_" + i + "-" + j;
            int y = getRandomValue(10.0d);
            double[] xSeries = new double[] { i };
            double[] ySeries = new double[] { y };
            ISeriesData seriesData = new SeriesData(xSeries, ySeries, id);
            IScatterSeriesData scatterSeriesData = new ScatterSeriesData(seriesData);
            IScatterSeriesSettings scatterSeriesSettings = scatterSeriesData.getScatterSeriesSettings();
            scatterSeriesSettings.setDescription(id);
            scatterSeriesSettings.setSymbolSize(getRandomValue(30.0d));
            scatterSeriesSettings.setSymbolColor(colors.get(y));
            scatterSeriesSettings.setSymbolType(PlotSymbolType.CIRCLE);
            scatterSeriesDataList.add(scatterSeriesData);
        }
    }
    addSeriesData(scatterSeriesDataList);
}
Also used : IScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesData) IScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesData) ScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.ScatterSeriesData) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) DecimalFormatSymbols(java.text.DecimalFormatSymbols) IScatterSeriesSettings(org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesSettings) HashMap(java.util.HashMap) DecimalFormat(java.text.DecimalFormat) Color(org.eclipse.swt.graphics.Color) ArrayList(java.util.ArrayList) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) SeriesData(org.eclipse.swtchart.extensions.core.SeriesData) IScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesData) ScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.ScatterSeriesData) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) RangeRestriction(org.eclipse.swtchart.extensions.core.RangeRestriction) IPrimaryAxisSettings(org.eclipse.swtchart.extensions.core.IPrimaryAxisSettings)

Example 9 with IChartSettings

use of org.eclipse.swtchart.extensions.core.IChartSettings in project swtchart by eclipse.

the class ScatterSeries_Edit_Part method loadScatterData.

private void loadScatterData() {
    /*
		 * Chart Settings
		 */
    IChartSettings chartSettings = handledChart.getChartSettings();
    chartSettings.setCreateMenu(true);
    handledChart.applySettings(chartSettings);
    /*
		 * Data
		 */
    List<ISeriesData> scatterSeriesList = SeriesConverter.getSeriesScatter(SeriesConverter.SCATTER_SERIES_1);
    List<IScatterSeriesData> scatterSeriesDataList = new ArrayList<IScatterSeriesData>();
    // 
    for (ISeriesData seriesData : scatterSeriesList) {
        IScatterSeriesData scatterSeriesData = new ScatterSeriesData(seriesData);
        IScatterSeriesSettings scatterSeriesSettings = scatterSeriesData.getScatterSeriesSettings();
        /*
			 * Set the color and symbol type.
			 */
        double x = seriesData.getXSeries()[0];
        double y = seriesData.getYSeries()[0];
        applySettings(scatterSeriesSettings, x, y, SYMBOL_SIZE);
        scatterSeriesDataList.add(scatterSeriesData);
    }
    /*
		 * Set series.
		 */
    handledChart.addSeriesData(scatterSeriesDataList);
}
Also used : IScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesData) IScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesData) ScatterSeriesData(org.eclipse.swtchart.extensions.scattercharts.ScatterSeriesData) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) IScatterSeriesSettings(org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesSettings) IChartSettings(org.eclipse.swtchart.extensions.core.IChartSettings) ArrayList(java.util.ArrayList)

Example 10 with IChartSettings

use of org.eclipse.swtchart.extensions.core.IChartSettings 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)

Aggregations

IChartSettings (org.eclipse.swtchart.extensions.core.IChartSettings)35 ArrayList (java.util.ArrayList)24 ISeriesData (org.eclipse.swtchart.extensions.core.ISeriesData)24 ILineSeriesData (org.eclipse.swtchart.extensions.linecharts.ILineSeriesData)15 ILineSeriesSettings (org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings)15 LineSeriesData (org.eclipse.swtchart.extensions.linecharts.LineSeriesData)15 DecimalFormat (java.text.DecimalFormat)14 DecimalFormatSymbols (java.text.DecimalFormatSymbols)14 IPrimaryAxisSettings (org.eclipse.swtchart.extensions.core.IPrimaryAxisSettings)14 RangeRestriction (org.eclipse.swtchart.extensions.core.RangeRestriction)8 Color (org.eclipse.swt.graphics.Color)7 ISecondaryAxisSettings (org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings)7 SecondaryAxisSettings (org.eclipse.swtchart.extensions.core.SecondaryAxisSettings)6 HashMap (java.util.HashMap)5 IPlotArea (org.eclipse.swtchart.IPlotArea)5 RelativeIntensityConverter (org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter)5 BarSeriesData (org.eclipse.swtchart.extensions.barcharts.BarSeriesData)5 IBarSeriesData (org.eclipse.swtchart.extensions.barcharts.IBarSeriesData)5 LabelMarker (org.eclipse.swtchart.extensions.marker.LabelMarker)5 IScatterSeriesData (org.eclipse.swtchart.extensions.scattercharts.IScatterSeriesData)4