]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - panel/RRDChart.js
add missing htmlEncodes
[proxmox-widget-toolkit.git] / panel / RRDChart.js
index 103137e60b5d608cf5715b9111e79d94a1156c36..27b35b0e37c1b453cf9a600f38f94c6a62a2cc25 100644 (file)
@@ -3,7 +3,7 @@ Ext.define('Proxmox.widget.RRDChart', {
     alias: 'widget.proxmoxRRDChart',
 
     unit: undefined, // bytes, bytespersecond, percent
-    
+
     controller: {
        xclass: 'Ext.app.ViewController',
 
@@ -17,10 +17,10 @@ Ext.define('Proxmox.widget.RRDChart', {
 
            // javascript floating point weirdness
            value = Ext.Number.correctFloat(value);
-           
+
            // limit to 2 decimal points
            value = Ext.util.Format.number(value, "0.##");
-           
+
            return value.toString() + " " + units[si];
        },
 
@@ -32,9 +32,9 @@ Ext.define('Proxmox.widget.RRDChart', {
 
        onSeriesTooltipRender: function(tooltip, record, item) {
            var me = this.getView();
-           
+
            var suffix = '';
-           
+
            if (me.unit === 'percent') {
                suffix = '%';
            } else if (me.unit === 'bytes') {
@@ -42,7 +42,7 @@ Ext.define('Proxmox.widget.RRDChart', {
            } else if (me.unit === 'bytespersecond') {
                suffix = 'B/s';
            }
-           
+
            var prefix = item.field;
            if (me.fieldTitles && me.fieldTitles[me.fields.indexOf(item.field)]) {
                prefix = me.fieldTitles[me.fields.indexOf(item.field)];
@@ -60,7 +60,7 @@ Ext.define('Proxmox.widget.RRDChart', {
            ourUndoZoomButton.setDisabled(undoButton.isDisabled());
        }
     },
-    
+
     width: 770,
     height: 300,
     animation: false,
@@ -90,6 +90,7 @@ Ext.define('Proxmox.widget.RRDChart', {
 
     initComponent: function() {
        var me = this;
+       var series = {};
 
        if (!me.store) {
            throw "cannot work without store";
@@ -145,33 +146,36 @@ Ext.define('Proxmox.widget.RRDChart', {
            if (me.fieldTitles && me.fieldTitles[index]) {
                title = me.fieldTitles[index];
            }
-           me.addSeries({
-               type: 'line',
-               xField: 'time',
-               yField: item,
-               title: title,
-               fill: true,
-               style: {
-                   lineWidth: 1.5,
-                   opacity: 0.60
-               },
-               marker: {
-                   opacity: 0,
-                   scaling: 0.01,
-                   fx: {
-                       duration: 200,
-                       easing: 'easeOut'
+           me.addSeries(Ext.apply(
+               {
+                   type: 'line',
+                   xField: 'time',
+                   yField: item,
+                   title: title,
+                   fill: true,
+                   style: {
+                       lineWidth: 1.5,
+                       opacity: 0.60
+                   },
+                   marker: {
+                       opacity: 0,
+                       scaling: 0.01,
+                       fx: {
+                           duration: 200,
+                           easing: 'easeOut'
+                       }
+                   },
+                   highlightCfg: {
+                       opacity: 1,
+                       scaling: 1.5
+                   },
+                   tooltip: {
+                       trackMouse: true,
+                       renderer: 'onSeriesTooltipRender'
                    }
                },
-               highlightCfg: {
-                   opacity: 1,
-                   scaling: 1.5
-               },
-               tooltip: {
-                   trackMouse: true,
-                   renderer: 'onSeriesTooltipRender'
-               }
-           });
+               me.seriesConfig
+           ));
        });
 
        // enable animation after the store is loaded