alias: 'widget.proxmoxRRDChart',
unit: undefined, // bytes, bytespersecond, percent
-
+
controller: {
xclass: 'Ext.app.ViewController',
// 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];
},
onSeriesTooltipRender: function(tooltip, record, item) {
var me = this.getView();
-
+
var suffix = '';
-
+
if (me.unit === 'percent') {
suffix = '%';
} else if (me.unit === 'bytes') {
} 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)];
ourUndoZoomButton.setDisabled(undoButton.isDisabled());
}
},
-
+
width: 770,
height: 300,
animation: false,
initComponent: function() {
var me = this;
+ var series = {};
if (!me.store) {
throw "cannot work without store";
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