move rrd legend to the bottom, make it toggleable

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@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-10-04 16:29:21 +02:00 committed by Dietmar Maurer
parent 7ec884caee
commit ed37370c4a

View File

@ -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;