refactor: simplify memory chart configuration by removing redundant series and adjusting color settings
This commit is contained in:
@@ -4199,12 +4199,10 @@
|
||||
});
|
||||
|
||||
var memoryOptions = Object.assign({}, baseOptions, {
|
||||
// Single series for memory usage; capacity is reflected via the y-axis max
|
||||
series: [{
|
||||
name: 'Memory Utilization',
|
||||
data: [],
|
||||
}, {
|
||||
name: 'Memory Max',
|
||||
data: [],
|
||||
}],
|
||||
yaxis: {
|
||||
labels: {
|
||||
@@ -4220,7 +4218,7 @@
|
||||
max: (typeof maxMem === 'number' && maxMem > 0) ? maxMem : undefined,
|
||||
min: 0,
|
||||
},
|
||||
colors: ['#00E396', '#159368'],
|
||||
colors: ['#00E396'],
|
||||
});
|
||||
|
||||
var networkOptions = Object.assign({}, baseOptions, {
|
||||
@@ -4452,23 +4450,15 @@
|
||||
console.warn('No Memory data received', eventData);
|
||||
return;
|
||||
}
|
||||
memoryChart.updateSeries([{
|
||||
memoryChart.updateSeries([{
|
||||
name: 'Memory Utilization',
|
||||
data: data.map(function(item) {
|
||||
return {
|
||||
x: item.time * 1000,
|
||||
y: item.mem ? item.mem : 0,
|
||||
}
|
||||
}),
|
||||
}, {
|
||||
name: 'Memory Max',
|
||||
data: data.map(function(item) {
|
||||
return {
|
||||
x: item.time * 1000,
|
||||
y: item.maxmem ? item.maxmem : 0,
|
||||
}
|
||||
})
|
||||
}]);
|
||||
data: data.map(function(item) {
|
||||
return {
|
||||
x: item.time * 1000,
|
||||
y: item.mem ? item.mem : 0,
|
||||
}
|
||||
}),
|
||||
}]);
|
||||
|
||||
// Mark that this chart has successfully received data
|
||||
memoryChartHasData = true;
|
||||
|
||||
Reference in New Issue
Block a user