Line/area switch for all DCIs on chart level (issue #1112)
authorVictor Kirhenshtein <victor@netxms.org>
Sun, 29 May 2016 12:56:10 +0000 (15:56 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Sun, 29 May 2016 12:56:10 +0000 (15:56 +0300)
13 files changed:
ChangeLog
src/java/netxms-eclipse/Charts/src/org/netxms/ui/eclipse/charts/api/ChartDciConfig.java
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/dialogs/DataSourceEditDlg.java
src/java/netxms-eclipse/PerfView/META-INF/MANIFEST.MF
src/java/netxms-eclipse/PerfView/src/org/netxms/ui/eclipse/perfview/ChartConfig.java
src/java/netxms-eclipse/PerfView/src/org/netxms/ui/eclipse/perfview/propertypages/General.java
src/java/netxms-eclipse/PerfView/src/org/netxms/ui/eclipse/perfview/views/HistoricalGraphView.java
webui/webapp/Charts/src/org/netxms/ui/eclipse/charts/api/ChartDciConfig.java
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/dialogs/DataSourceEditDlg.java
webui/webapp/PerfView/META-INF/MANIFEST.MF
webui/webapp/PerfView/src/org/netxms/ui/eclipse/perfview/ChartConfig.java
webui/webapp/PerfView/src/org/netxms/ui/eclipse/perfview/propertypages/General.java
webui/webapp/PerfView/src/org/netxms/ui/eclipse/perfview/views/HistoricalGraphView.java

index c041980..ac52297 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        - DCI filter in DCI selection dialog
        - Configurable line width on ad-hoc line charts
        - Object tooltips in rack view
+       - Line/area switch for all DCIs on chart level
 - Android console
        - Reorganized alarm notification section (issue #1194)
-- Fixed issues: #405, #775, #859, #984, #1086, #1186, #1194, #1195, #1196, #1197, #1200, #1209, #1210, #1214, #1223, #1227, #1231
+- Fixed issues: #405, #775, #859, #984, #1086, #1112, #1186, #1194, #1195, #1196, #1197, #1200, #1209, #1210, #1214, #1223, #1227, #1231
 
 
 *
index 0166f0e..3b71182 100644 (file)
@@ -35,6 +35,11 @@ public class ChartDciConfig
        public static final int ITEM = DataCollectionObject.DCO_TYPE_ITEM;
        public static final int TABLE = DataCollectionObject.DCO_TYPE_TABLE;
        
+       // display types
+       public static final int DEFAULT = 0;
+   public static final int LINE = 1;
+   public static final int AREA = 2;
+       
        @Attribute
        public long nodeId;
        
@@ -53,6 +58,9 @@ public class ChartDciConfig
        @Element(required=false)
        public int lineWidth;
        
+       @Element(required=false)
+       public int displayType;
+       
        @Element(required=false)
        public boolean area;
        
@@ -82,6 +90,7 @@ public class ChartDciConfig
                color = UNSET_COLOR;
                name = ""; //$NON-NLS-1$
                lineWidth = 2;
+               displayType = DEFAULT;
                area = false;
                showThresholds = false;
                invertValues = false;
@@ -103,6 +112,7 @@ public class ChartDciConfig
                this.color = src.color;
                this.name = src.name;
                this.lineWidth = src.lineWidth;
+               this.displayType = src.displayType;
                this.area = src.area;
                this.showThresholds = src.showThresholds;
                this.invertValues = src.invertValues;
@@ -170,4 +180,14 @@ public class ChartDciConfig
        {
           return ((displayFormat != null) && !displayFormat.isEmpty()) ? displayFormat : "%s"; //$NON-NLS-1$
        }
+       
+       /**
+        * Get display type
+        * 
+        * @return
+        */
+       public int getDisplayType()
+       {
+          return ((displayType == DEFAULT) && area) ? AREA : displayType;
+       }
 }
index 3f14ce5..55d743a 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Group;
@@ -49,7 +50,7 @@ public class DataSourceEditDlg extends Dialog
        private Button colorAuto;
        private Button colorCustom;
        private ColorSelector colorSelector;
-       private Button checkAreaChart;
+       private Combo displayType;
        private Button checkShowThresholds;
        private Button checkInvertValues;
        private LabeledText instance;
@@ -148,6 +149,38 @@ public class DataSourceEditDlg extends Dialog
                        instance.setLayoutData(gd);
                }
                
+      /*** Display type ***/
+      gd = new GridData();
+      gd.horizontalAlignment = SWT.FILL;
+      gd.verticalAlignment = SWT.TOP;
+      displayType = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY | SWT.BORDER, "Display type", gd);
+      displayType.add("Default");
+      displayType.add("Line");
+      displayType.add("Area");
+      displayType.select(dci.getDisplayType());
+            
+      /*** Options group ***/
+      Group optionsGroup = new Group(dialogArea, SWT.NONE);
+      optionsGroup.setText(Messages.get().DataSourceEditDlg_Options);
+      gd = new GridData();
+      gd.horizontalAlignment = SWT.FILL;
+      gd.grabExcessHorizontalSpace = true;
+      gd.verticalAlignment = SWT.TOP;
+      gd.verticalSpan = 2;
+      optionsGroup.setLayoutData(gd);
+      
+      layout = new GridLayout();
+      optionsGroup.setLayout(layout);
+
+      checkShowThresholds = new Button(optionsGroup, SWT.CHECK);
+      checkShowThresholds.setText(Messages.get().DataSourceEditDlg_ShowThresholds);
+      checkShowThresholds.setSelection(dci.showThresholds);
+      
+      checkInvertValues = new Button(optionsGroup, SWT.CHECK);
+      checkInvertValues.setText(Messages.get().DataSourceEditDlg_InvertValues);
+      checkInvertValues.setSelection(dci.invertValues);
+
+      /*** Color group ***/
                Group colorGroup = new Group(dialogArea, SWT.NONE);
                colorGroup.setText(Messages.get().DataSourceEditDlg_Color);
                gd = new GridData();
@@ -205,29 +238,6 @@ public class DataSourceEditDlg extends Dialog
                colorSelector.getButton().setLayoutData(gd);
                colorSelector.setEnabled(!dci.color.equalsIgnoreCase(ChartDciConfig.UNSET_COLOR));
                
-               Group optionsGroup = new Group(dialogArea, SWT.NONE);
-               optionsGroup.setText(Messages.get().DataSourceEditDlg_Options);
-               gd = new GridData();
-               gd.horizontalAlignment = SWT.FILL;
-               gd.grabExcessHorizontalSpace = true;
-               gd.verticalAlignment = SWT.FILL;
-               optionsGroup.setLayoutData(gd);
-               
-               layout = new GridLayout();
-               optionsGroup.setLayout(layout);
-               
-               checkAreaChart = new Button(optionsGroup, SWT.CHECK);
-               checkAreaChart.setText(Messages.get().DataSourceEditDlg_AreaChart);
-               checkAreaChart.setSelection(dci.area);
-               
-               checkShowThresholds = new Button(optionsGroup, SWT.CHECK);
-               checkShowThresholds.setText(Messages.get().DataSourceEditDlg_ShowThresholds);
-               checkShowThresholds.setSelection(dci.showThresholds);
-               
-      checkInvertValues = new Button(optionsGroup, SWT.CHECK);
-      checkInvertValues.setText(Messages.get().DataSourceEditDlg_InvertValues);
-      checkInvertValues.setSelection(dci.invertValues);
-      
                return dialogArea;
        }
 
@@ -249,7 +259,8 @@ public class DataSourceEditDlg extends Dialog
                {
                        dci.color = "0x" + Integer.toHexString(ColorConverter.rgbToInt(colorSelector.getColorValue())); //$NON-NLS-1$
                }
-               dci.area = checkAreaChart.getSelection();
+               dci.area = false;
+               dci.displayType = displayType.getSelectionIndex();
                dci.showThresholds = checkShowThresholds.getSelection();
                dci.invertValues = checkInvertValues.getSelection();
                if (dci.type == ChartDciConfig.TABLE)
index d30ac4c..65617d0 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Performance View Plug-in for NXMC
 Bundle-SymbolicName: org.netxms.ui.eclipse.perfview;singleton:=true
-Bundle-Version: 2.0.7
+Bundle-Version: 2.0.8
 Bundle-Activator: org.netxms.ui.eclipse.perfview.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui;bundle-version="3.8.2",
@@ -10,9 +10,9 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.8.2",
  org.netxms.ui.eclipse.clientlibrary;bundle-version="2.0.10",
  org.netxms.ui.eclipse.console;bundle-version="2.0.10",
  org.netxms.ui.eclipse.charts;bundle-version="2.0.5",
- org.netxms.ui.eclipse.objectview;bundle-version="2.0.3",
- org.netxms.ui.eclipse.datacollection;bundle-version="2.0.4",
- org.netxms.ui.eclipse.usermanager;bundle-version="2.0.4"
+ org.netxms.ui.eclipse.objectview;bundle-version="2.0.7",
+ org.netxms.ui.eclipse.datacollection;bundle-version="2.0.7",
+ org.netxms.ui.eclipse.usermanager;bundle-version="2.0.8"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Export-Package: org.netxms.ui.eclipse.perfview.views.helpers,
index 8f35c9e..de98b24 100644 (file)
@@ -75,6 +75,9 @@ public class ChartConfig
    @Element(required = false)
    private boolean translucent = true;
    
+   @Element(required = false)
+   private boolean area = false;
+   
    @Element(required = false)
    private int lineWidth = 2;
    
@@ -733,6 +736,22 @@ public class ChartConfig
       this.autoScale = autoScale;
    }
 
+   /**
+    * @return the area
+    */
+   public boolean isArea()
+   {
+      return area;
+   }
+
+   /**
+    * @param area the area to set
+    */
+   public void setArea(boolean area)
+   {
+      this.area = area;
+   }
+
    /**
     * @return
     */
index 8d437a5..b4db54a 100644 (file)
@@ -61,6 +61,7 @@ public class General extends PropertyPage
        private Button checkStacked;
        private Button checkExtendedLegend;
    private Button checkTranslucent;
+   private Button checkAreaChart;
    private LabeledSpinner lineWidth;
        private Combo legendLocation;
        private Scale refreshIntervalScale;
@@ -173,6 +174,10 @@ public class General extends PropertyPage
       checkExtendedLegend.setSelection(config.isExtendedLegend());         
       checkExtendedLegend.setEnabled(config.isShowLegend());   
       
+      checkAreaChart = new Button(optionsGroup, SWT.CHECK);
+      checkAreaChart.setText("Area chart");
+      checkAreaChart.setSelection(config.isArea());         
+      
       Composite refreshGroup = new Composite(optionsGroup, SWT.NONE);
       layout = new GridLayout();
       layout.horizontalSpacing = WidgetHelper.OUTER_SPACING;
@@ -298,7 +303,8 @@ public class General extends PropertyPage
                checkAutoRefresh.setSelection(true);
                checkLogScale.setSelection(false);
                checkStacked.setSelection(false);
-               checkExtendedLegend.setSelection(false);                
+               checkExtendedLegend.setSelection(false);
+               checkAreaChart.setSelection(false);
                legendLocation.select(3);
                lineWidth.setSelection(2);
                
@@ -327,6 +333,7 @@ public class General extends PropertyPage
                config.setRefreshRate(refreshIntervalSpinner.getSelection());
       config.setStacked(checkStacked.getSelection());
       config.setExtendedLegend(checkExtendedLegend.getSelection());
+      config.setArea(checkAreaChart.getSelection());
       config.setLegendPosition((int)Math.pow(2,legendLocation.getSelectionIndex()));
       config.setTranslucent(checkTranslucent.getSelection());
       config.setLineWidth(lineWidth.getSelection());
index 129662f..8b29f54 100644 (file)
@@ -110,6 +110,7 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
    private Action actionAdjustBoth;
    private Action actionLogScale;
    private Action actionStacked;
+   private Action actionAreaChart;
    private Action actionTranslucent;
    private Action actionShowLegend;
    private Action actionExtendedLegend;
@@ -333,7 +334,7 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
          int color = dci.getColorAsInt();
          if (color == -1)
             color = ChartColor.getDefaultColor(index).getRGB();
-         styles.add(new GraphItemStyle(dci.area ? GraphItemStyle.AREA : GraphItemStyle.LINE, color, 2, dci.invertValues ? GraphItemStyle.INVERTED : 0));
+         styles.add(new GraphItemStyle(getDisplayType(dci), color, 2, dci.invertValues ? GraphItemStyle.INVERTED : 0));
          index++;
       }
       chart.setItemStyles(styles);
@@ -351,6 +352,24 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
       refreshMenuSelection();
       refreshController.setInterval(config.isAutoRefresh() ? config.getRefreshRate() : -1);
    }
+   
+   /**
+    * @param dci
+    * @return
+    */
+   private int getDisplayType(ChartDciConfig dci)
+   {
+      int type = dci.getDisplayType();
+      switch(type)
+      {
+         case ChartDciConfig.AREA:
+            return GraphItemStyle.AREA;
+         case ChartDciConfig.LINE:
+            return GraphItemStyle.LINE;
+         default:
+            return config.isArea() ? GraphItemStyle.AREA : GraphItemStyle.LINE;
+      } 
+   }
 
    /*
     * (non-Javadoc)
@@ -679,6 +698,16 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
          }
       };
       actionTranslucent.setChecked(config.isTranslucent());
+      
+      actionAreaChart = new Action("Area chart", Action.AS_CHECK_BOX) {
+         @Override
+         public void run()
+         {
+            config.setArea(actionAreaChart.isChecked());
+            configureGraphFromSettings();
+         }
+      };
+      actionAreaChart.setChecked(config.isArea());
 
       presetActions = new Action[presetRanges.length];
       for(int i = 0; i < presetRanges.length; i++)
@@ -718,6 +747,7 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
       actionExtendedLegend.setChecked(config.isExtendedLegend());
       actionStacked.setChecked(config.isStacked());
       actionTranslucent.setChecked(config.isTranslucent());
+      actionAreaChart.setChecked(config.isArea());
 
       actionLegendLeft.setChecked(config.getLegendPosition() == GraphSettings.POSITION_LEFT);
       actionLegendRight.setChecked(config.getLegendPosition() == GraphSettings.POSITION_RIGHT);
@@ -764,6 +794,7 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
       manager.add(actionZoomIn);
       manager.add(actionZoomOut);
       manager.add(new Separator());
+      manager.add(actionAreaChart);
       manager.add(actionStacked);
       manager.add(actionLogScale);
       manager.add(actionTranslucent);
@@ -805,6 +836,7 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
       manager.add(actionZoomIn);
       manager.add(actionZoomOut);
       manager.add(new Separator());
+      manager.add(actionAreaChart);
       manager.add(actionStacked);
       manager.add(actionLogScale);
       manager.add(actionTranslucent);
index 0166f0e..3b71182 100644 (file)
@@ -35,6 +35,11 @@ public class ChartDciConfig
        public static final int ITEM = DataCollectionObject.DCO_TYPE_ITEM;
        public static final int TABLE = DataCollectionObject.DCO_TYPE_TABLE;
        
+       // display types
+       public static final int DEFAULT = 0;
+   public static final int LINE = 1;
+   public static final int AREA = 2;
+       
        @Attribute
        public long nodeId;
        
@@ -53,6 +58,9 @@ public class ChartDciConfig
        @Element(required=false)
        public int lineWidth;
        
+       @Element(required=false)
+       public int displayType;
+       
        @Element(required=false)
        public boolean area;
        
@@ -82,6 +90,7 @@ public class ChartDciConfig
                color = UNSET_COLOR;
                name = ""; //$NON-NLS-1$
                lineWidth = 2;
+               displayType = DEFAULT;
                area = false;
                showThresholds = false;
                invertValues = false;
@@ -103,6 +112,7 @@ public class ChartDciConfig
                this.color = src.color;
                this.name = src.name;
                this.lineWidth = src.lineWidth;
+               this.displayType = src.displayType;
                this.area = src.area;
                this.showThresholds = src.showThresholds;
                this.invertValues = src.invertValues;
@@ -170,4 +180,14 @@ public class ChartDciConfig
        {
           return ((displayFormat != null) && !displayFormat.isEmpty()) ? displayFormat : "%s"; //$NON-NLS-1$
        }
+       
+       /**
+        * Get display type
+        * 
+        * @return
+        */
+       public int getDisplayType()
+       {
+          return ((displayType == DEFAULT) && area) ? AREA : displayType;
+       }
 }
index 3f14ce5..55d743a 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Group;
@@ -49,7 +50,7 @@ public class DataSourceEditDlg extends Dialog
        private Button colorAuto;
        private Button colorCustom;
        private ColorSelector colorSelector;
-       private Button checkAreaChart;
+       private Combo displayType;
        private Button checkShowThresholds;
        private Button checkInvertValues;
        private LabeledText instance;
@@ -148,6 +149,38 @@ public class DataSourceEditDlg extends Dialog
                        instance.setLayoutData(gd);
                }
                
+      /*** Display type ***/
+      gd = new GridData();
+      gd.horizontalAlignment = SWT.FILL;
+      gd.verticalAlignment = SWT.TOP;
+      displayType = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY | SWT.BORDER, "Display type", gd);
+      displayType.add("Default");
+      displayType.add("Line");
+      displayType.add("Area");
+      displayType.select(dci.getDisplayType());
+            
+      /*** Options group ***/
+      Group optionsGroup = new Group(dialogArea, SWT.NONE);
+      optionsGroup.setText(Messages.get().DataSourceEditDlg_Options);
+      gd = new GridData();
+      gd.horizontalAlignment = SWT.FILL;
+      gd.grabExcessHorizontalSpace = true;
+      gd.verticalAlignment = SWT.TOP;
+      gd.verticalSpan = 2;
+      optionsGroup.setLayoutData(gd);
+      
+      layout = new GridLayout();
+      optionsGroup.setLayout(layout);
+
+      checkShowThresholds = new Button(optionsGroup, SWT.CHECK);
+      checkShowThresholds.setText(Messages.get().DataSourceEditDlg_ShowThresholds);
+      checkShowThresholds.setSelection(dci.showThresholds);
+      
+      checkInvertValues = new Button(optionsGroup, SWT.CHECK);
+      checkInvertValues.setText(Messages.get().DataSourceEditDlg_InvertValues);
+      checkInvertValues.setSelection(dci.invertValues);
+
+      /*** Color group ***/
                Group colorGroup = new Group(dialogArea, SWT.NONE);
                colorGroup.setText(Messages.get().DataSourceEditDlg_Color);
                gd = new GridData();
@@ -205,29 +238,6 @@ public class DataSourceEditDlg extends Dialog
                colorSelector.getButton().setLayoutData(gd);
                colorSelector.setEnabled(!dci.color.equalsIgnoreCase(ChartDciConfig.UNSET_COLOR));
                
-               Group optionsGroup = new Group(dialogArea, SWT.NONE);
-               optionsGroup.setText(Messages.get().DataSourceEditDlg_Options);
-               gd = new GridData();
-               gd.horizontalAlignment = SWT.FILL;
-               gd.grabExcessHorizontalSpace = true;
-               gd.verticalAlignment = SWT.FILL;
-               optionsGroup.setLayoutData(gd);
-               
-               layout = new GridLayout();
-               optionsGroup.setLayout(layout);
-               
-               checkAreaChart = new Button(optionsGroup, SWT.CHECK);
-               checkAreaChart.setText(Messages.get().DataSourceEditDlg_AreaChart);
-               checkAreaChart.setSelection(dci.area);
-               
-               checkShowThresholds = new Button(optionsGroup, SWT.CHECK);
-               checkShowThresholds.setText(Messages.get().DataSourceEditDlg_ShowThresholds);
-               checkShowThresholds.setSelection(dci.showThresholds);
-               
-      checkInvertValues = new Button(optionsGroup, SWT.CHECK);
-      checkInvertValues.setText(Messages.get().DataSourceEditDlg_InvertValues);
-      checkInvertValues.setSelection(dci.invertValues);
-      
                return dialogArea;
        }
 
@@ -249,7 +259,8 @@ public class DataSourceEditDlg extends Dialog
                {
                        dci.color = "0x" + Integer.toHexString(ColorConverter.rgbToInt(colorSelector.getColorValue())); //$NON-NLS-1$
                }
-               dci.area = checkAreaChart.getSelection();
+               dci.area = false;
+               dci.displayType = displayType.getSelectionIndex();
                dci.showThresholds = checkShowThresholds.getSelection();
                dci.invertValues = checkInvertValues.getSelection();
                if (dci.type == ChartDciConfig.TABLE)
index 8d1aadc..e4a298b 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Performance View Plug-in for NXMC
 Bundle-SymbolicName: org.netxms.ui.eclipse.perfview;singleton:=true
-Bundle-Version: 2.0.7
+Bundle-Version: 2.0.8
 Bundle-Activator: org.netxms.ui.eclipse.perfview.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.rap.ui;bundle-version="2.3.2",
index 8f35c9e..de98b24 100644 (file)
@@ -75,6 +75,9 @@ public class ChartConfig
    @Element(required = false)
    private boolean translucent = true;
    
+   @Element(required = false)
+   private boolean area = false;
+   
    @Element(required = false)
    private int lineWidth = 2;
    
@@ -733,6 +736,22 @@ public class ChartConfig
       this.autoScale = autoScale;
    }
 
+   /**
+    * @return the area
+    */
+   public boolean isArea()
+   {
+      return area;
+   }
+
+   /**
+    * @param area the area to set
+    */
+   public void setArea(boolean area)
+   {
+      this.area = area;
+   }
+
    /**
     * @return
     */
index 8d437a5..b4db54a 100644 (file)
@@ -61,6 +61,7 @@ public class General extends PropertyPage
        private Button checkStacked;
        private Button checkExtendedLegend;
    private Button checkTranslucent;
+   private Button checkAreaChart;
    private LabeledSpinner lineWidth;
        private Combo legendLocation;
        private Scale refreshIntervalScale;
@@ -173,6 +174,10 @@ public class General extends PropertyPage
       checkExtendedLegend.setSelection(config.isExtendedLegend());         
       checkExtendedLegend.setEnabled(config.isShowLegend());   
       
+      checkAreaChart = new Button(optionsGroup, SWT.CHECK);
+      checkAreaChart.setText("Area chart");
+      checkAreaChart.setSelection(config.isArea());         
+      
       Composite refreshGroup = new Composite(optionsGroup, SWT.NONE);
       layout = new GridLayout();
       layout.horizontalSpacing = WidgetHelper.OUTER_SPACING;
@@ -298,7 +303,8 @@ public class General extends PropertyPage
                checkAutoRefresh.setSelection(true);
                checkLogScale.setSelection(false);
                checkStacked.setSelection(false);
-               checkExtendedLegend.setSelection(false);                
+               checkExtendedLegend.setSelection(false);
+               checkAreaChart.setSelection(false);
                legendLocation.select(3);
                lineWidth.setSelection(2);
                
@@ -327,6 +333,7 @@ public class General extends PropertyPage
                config.setRefreshRate(refreshIntervalSpinner.getSelection());
       config.setStacked(checkStacked.getSelection());
       config.setExtendedLegend(checkExtendedLegend.getSelection());
+      config.setArea(checkAreaChart.getSelection());
       config.setLegendPosition((int)Math.pow(2,legendLocation.getSelectionIndex()));
       config.setTranslucent(checkTranslucent.getSelection());
       config.setLineWidth(lineWidth.getSelection());
index 5a020c8..d2dc132 100644 (file)
@@ -106,6 +106,7 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
    private Action actionAdjustBoth;
    private Action actionLogScale;
    private Action actionStacked;
+   private Action actionAreaChart;
    private Action actionTranslucent;
    private Action actionShowLegend;
    private Action actionExtendedLegend;
@@ -328,7 +329,7 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
          int color = dci.getColorAsInt();
          if (color == -1)
             color = ChartColor.getDefaultColor(index).getRGB();
-         styles.add(new GraphItemStyle(dci.area ? GraphItemStyle.AREA : GraphItemStyle.LINE, color, 2, dci.invertValues ? GraphItemStyle.INVERTED : 0));
+         styles.add(new GraphItemStyle(getDisplayType(dci), color, 2, dci.invertValues ? GraphItemStyle.INVERTED : 0));
          index++;
       }
       chart.setItemStyles(styles);
@@ -346,6 +347,24 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
       refreshMenuSelection();
       refreshController.setInterval(config.isAutoRefresh() ? config.getRefreshRate() : -1);
    }
+   
+   /**
+    * @param dci
+    * @return
+    */
+   private int getDisplayType(ChartDciConfig dci)
+   {
+      int type = dci.getDisplayType();
+      switch(type)
+      {
+         case ChartDciConfig.AREA:
+            return GraphItemStyle.AREA;
+         case ChartDciConfig.LINE:
+            return GraphItemStyle.LINE;
+         default:
+            return config.isArea() ? GraphItemStyle.AREA : GraphItemStyle.LINE;
+      } 
+   }
 
    /*
     * (non-Javadoc)
@@ -674,6 +693,16 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
          }
       };
       actionTranslucent.setChecked(config.isTranslucent());
+      
+      actionAreaChart = new Action("Area chart", Action.AS_CHECK_BOX) {
+         @Override
+         public void run()
+         {
+            config.setArea(actionAreaChart.isChecked());
+            configureGraphFromSettings();
+         }
+      };
+      actionAreaChart.setChecked(config.isArea());
 
       presetActions = new Action[presetRanges.length];
       for(int i = 0; i < presetRanges.length; i++)
@@ -702,6 +731,7 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
       actionExtendedLegend.setChecked(config.isExtendedLegend());
       actionStacked.setChecked(config.isStacked());
       actionTranslucent.setChecked(config.isTranslucent());
+      actionAreaChart.setChecked(config.isArea());
 
       actionLegendLeft.setChecked(config.getLegendPosition() == GraphSettings.POSITION_LEFT);
       actionLegendRight.setChecked(config.getLegendPosition() == GraphSettings.POSITION_RIGHT);
@@ -748,6 +778,7 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
       manager.add(actionZoomIn);
       manager.add(actionZoomOut);
       manager.add(new Separator());
+      manager.add(actionAreaChart);
       manager.add(actionStacked);
       manager.add(actionLogScale);
       manager.add(actionTranslucent);
@@ -789,6 +820,7 @@ public class HistoricalGraphView extends ViewPart implements GraphSettingsChange
       manager.add(actionZoomIn);
       manager.add(actionZoomOut);
       manager.add(new Separator());
+      manager.add(actionAreaChart);
       manager.add(actionStacked);
       manager.add(actionLogScale);
       manager.add(actionTranslucent);