Search in sources :

Example 21 with ILineSeriesSettings

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();
}
Also used : ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData) LineSeriesData(org.eclipse.swtchart.extensions.linecharts.LineSeriesData) ISeriesData(org.eclipse.swtchart.extensions.core.ISeriesData) HashMap(java.util.HashMap) Color(org.eclipse.swt.graphics.Color) ArrayList(java.util.ArrayList) ILineSeriesSettings(org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings) ILineSeriesData(org.eclipse.swtchart.extensions.linecharts.ILineSeriesData)

Aggregations

ILineSeriesSettings (org.eclipse.swtchart.extensions.linecharts.ILineSeriesSettings)21 ArrayList (java.util.ArrayList)20 ISeriesData (org.eclipse.swtchart.extensions.core.ISeriesData)20 ILineSeriesData (org.eclipse.swtchart.extensions.linecharts.ILineSeriesData)20 LineSeriesData (org.eclipse.swtchart.extensions.linecharts.LineSeriesData)20 IChartSettings (org.eclipse.swtchart.extensions.core.IChartSettings)15 DecimalFormat (java.text.DecimalFormat)7 DecimalFormatSymbols (java.text.DecimalFormatSymbols)7 IPrimaryAxisSettings (org.eclipse.swtchart.extensions.core.IPrimaryAxisSettings)7 Color (org.eclipse.swt.graphics.Color)4 IPlotArea (org.eclipse.swtchart.IPlotArea)4 LabelMarker (org.eclipse.swtchart.extensions.marker.LabelMarker)4 HashMap (java.util.HashMap)3 ISecondaryAxisSettings (org.eclipse.swtchart.extensions.core.ISecondaryAxisSettings)3 SecondaryAxisSettings (org.eclipse.swtchart.extensions.core.SecondaryAxisSettings)3 RelativeIntensityConverter (org.eclipse.swtchart.extensions.axisconverter.RelativeIntensityConverter)2 ChromatogramChart (org.eclipse.swtchart.extensions.customcharts.ChromatogramChart)2 File (java.io.File)1 List (java.util.List)1 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)1