mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-06-21 15:27:48 +00:00
rrd charts: add legend to header for better space usage
Docking the legend to the bottom took space away from the chart, and was the just used as the simplest solution when it was implemented. The panel header has enough spaces for any reasonable number of different series in a chart, so move it there. Drop then the legend toggle tool from the header as it isn't required anymore.. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
efa61051ac
commit
e662b4a0b8
@ -70,7 +70,7 @@ Ext.define('Proxmox.widget.RRDChart', {
|
||||
},
|
||||
],
|
||||
legend: {
|
||||
docked: 'bottom'
|
||||
padding: 0,
|
||||
},
|
||||
axes: [
|
||||
{
|
||||
@ -121,8 +121,12 @@ Ext.define('Proxmox.widget.RRDChart', {
|
||||
|
||||
me.axes[0].setTitle(axisTitle);
|
||||
|
||||
me.updateHeader();
|
||||
me.header.padding = '4 9 4';
|
||||
me.header.add(me.legend);
|
||||
|
||||
if (!me.noTool) {
|
||||
me.addTool([{
|
||||
me.addTool({
|
||||
type: 'minus',
|
||||
disabled: true,
|
||||
tooltip: gettext('Undo Zoom'),
|
||||
@ -132,15 +136,7 @@ Ext.define('Proxmox.widget.RRDChart', {
|
||||
undoButton.handler();
|
||||
}
|
||||
}
|
||||
},{
|
||||
type: 'restore',
|
||||
tooltip: gettext('Toggle Legend'),
|
||||
handler: function(){
|
||||
if (me.legend) {
|
||||
me.legend.setVisible(!me.legend.isVisible());
|
||||
}
|
||||
}
|
||||
}]);
|
||||
});
|
||||
}
|
||||
|
||||
// add a series for each field we get
|
||||
|
Loading…
Reference in New Issue
Block a user