[pve-devel] [PATCH manager 2/4] move rrd legend to the bottom, make it toggleable
Dominik Csapak
d.csapak at proxmox.com
Tue Oct 4 16:29:21 CEST 2016
this is to make up for the lost width,
and to make up for the lost height, you
can now toggle the legend
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
www/manager6/panel/RRDChart.js | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/www/manager6/panel/RRDChart.js b/www/manager6/panel/RRDChart.js
index 449eb4a..5b2abf1 100644
--- a/www/manager6/panel/RRDChart.js
+++ b/www/manager6/panel/RRDChart.js
@@ -22,9 +22,7 @@ Ext.define('PVE.widget.RRDChart', {
fields: ['time']
}],
legend: {
- docked: 'right',
- // we set this that all graphs have same width
- width: 140
+ docked: 'bottom'
},
listeners: {
afterrender: 'onAfterRender',
@@ -112,8 +110,7 @@ Ext.define('PVE.widget.RRDChart', {
}
me.axes[0].setTitle(axisTitle);
-
- me.addTool({
+ me.addTool([{
type: 'minus',
disabled: true,
tooltip: gettext('Undo Zoom'),
@@ -123,7 +120,13 @@ Ext.define('PVE.widget.RRDChart', {
undoButton.handler();
}
}
- });
+ },{
+ type: 'restore',
+ tooltip: gettext('Toggle Legend'),
+ handler: function(){
+ me.legend.setVisible(!me.legend.isVisible());
+ }
+ }]);
// add a series for each field we get
me.fields.forEach(function(item, index){
var title = item;
--
2.1.4
More information about the pve-devel
mailing list