mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-08-07 15:06:44 +00:00
rrd charts: cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
c58d410099
commit
efa61051ac
@ -48,15 +48,14 @@ Ext.define('Proxmox.widget.RRDChart', {
|
|||||||
if (me.fieldTitles && me.fieldTitles[me.fields.indexOf(item.field)]) {
|
if (me.fieldTitles && me.fieldTitles[me.fields.indexOf(item.field)]) {
|
||||||
prefix = me.fieldTitles[me.fields.indexOf(item.field)];
|
prefix = me.fieldTitles[me.fields.indexOf(item.field)];
|
||||||
}
|
}
|
||||||
tooltip.setHtml(prefix + ': ' + this.convertToUnits(record.get(item.field)) + suffix +
|
let v = this.convertToUnits(record.get(item.field));
|
||||||
'<br>' + new Date(record.get('time')));
|
let t = new Date(record.get('time'));
|
||||||
|
tooltip.setHtml(`${prefix}: ${v}${suffix}<br>${t}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
onAfterAnimation: function(chart, eopts) {
|
onAfterAnimation: function(chart, eopts) {
|
||||||
// if the undobuton is disabled,
|
// if the undo button is disabled, disable our tool
|
||||||
// disable our tool
|
var ourUndoZoomButton = chart.header.tools[0];
|
||||||
|
|
||||||
var ourUndoZoomButton = chart.tools[0];
|
|
||||||
var undoButton = chart.interactions[0].getUndoButton();
|
var undoButton = chart.interactions[0].getUndoButton();
|
||||||
ourUndoZoomButton.setDisabled(undoButton.isDisabled());
|
ourUndoZoomButton.setDisabled(undoButton.isDisabled());
|
||||||
}
|
}
|
||||||
@ -65,30 +64,33 @@ Ext.define('Proxmox.widget.RRDChart', {
|
|||||||
width: 770,
|
width: 770,
|
||||||
height: 300,
|
height: 300,
|
||||||
animation: false,
|
animation: false,
|
||||||
interactions: [{
|
interactions: [
|
||||||
type: 'crosszoom'
|
{
|
||||||
}],
|
type: 'crosszoom'
|
||||||
axes: [{
|
},
|
||||||
type: 'numeric',
|
],
|
||||||
position: 'left',
|
|
||||||
grid: true,
|
|
||||||
renderer: 'leftAxisRenderer',
|
|
||||||
//renderer: function(axis, label) { return label; },
|
|
||||||
minimum: 0
|
|
||||||
}, {
|
|
||||||
type: 'time',
|
|
||||||
position: 'bottom',
|
|
||||||
grid: true,
|
|
||||||
fields: ['time']
|
|
||||||
}],
|
|
||||||
legend: {
|
legend: {
|
||||||
docked: 'bottom'
|
docked: 'bottom'
|
||||||
},
|
},
|
||||||
|
axes: [
|
||||||
|
{
|
||||||
|
type: 'numeric',
|
||||||
|
position: 'left',
|
||||||
|
grid: true,
|
||||||
|
renderer: 'leftAxisRenderer',
|
||||||
|
minimum: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'time',
|
||||||
|
position: 'bottom',
|
||||||
|
grid: true,
|
||||||
|
fields: ['time']
|
||||||
|
},
|
||||||
|
],
|
||||||
listeners: {
|
listeners: {
|
||||||
animationend: 'onAfterAnimation'
|
animationend: 'onAfterAnimation'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
var series = {};
|
var series = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user