make monitoring apps graph height responsive to highest percentage of array

master
michael mead 7 years ago
parent 591dd5f48f
commit 5b0274c9a2

@ -34,13 +34,17 @@ dashboard = {
// monitoring apps chart // monitoring apps chart
var dataChart = { var dataChart = {
labels: ['24','23','22','21','20','19','18','17','16','15','14','13','12','11','10','9','8','7','6','5','4','3','2','1' ], labels: ['24','23','22','21','20','19','18','17','16','15','14','13','12','11','10','9','8','7','6','5','4','3','2','1' ],
series: [cpu, memory_used, [1,2,3,50], ] // TODO: Check the order, the graph is by index not name. series: [cpu, memory_used, [1,2,3,5], ] // TODO: Check the order, the graph is by index not name.
}; };
dataChartArray = dataChart.series
var maxlist = dataChartArray.map(dataChartArray => Math.max.apply(null, dataChartArray));
maxNum = Math.max.apply(null, maxlist)
var optionsChart = { var optionsChart = {
lineSmooth: false, lineSmooth: false,
low: 0, low: 0,
high: 10, high: maxNum + 1,
showArea: true, showArea: true,
height: "245px", height: "245px",
axisX: { axisX: {

@ -301,7 +301,6 @@
<div class="footer"> <div class="footer">
<div class="chart-legend"> <div class="chart-legend">
<!-- confirm these three are right with new API. -->
<i class="fa fa-circle text-info"></i> cpu usage <i class="fa fa-circle text-info"></i> cpu usage
<i class="fa fa-circle text-warning"></i> memory used <i class="fa fa-circle text-warning"></i> memory used
<i class="fa fa-circle text-danger"></i> available line <i class="fa fa-circle text-danger"></i> available line

Loading…
Cancel
Save