|
|
|
@ -101,19 +101,28 @@ monitor.processes.trend.render = function (logs, key,label) {
|
|
|
|
|
]
|
|
|
|
|
conf.data.datasets = [ ]
|
|
|
|
|
var x_axis = []
|
|
|
|
|
var _x = {}
|
|
|
|
|
var _y = {}
|
|
|
|
|
var values = jx.utils.patterns.visitor(logs,function(item){
|
|
|
|
|
x = new Date(item.year,item.month-1,item.day,item.hour,item.minute)
|
|
|
|
|
y = item[key]
|
|
|
|
|
x_axis.push(x)
|
|
|
|
|
|
|
|
|
|
return {x:x,y:y}
|
|
|
|
|
if (_x[x] == null ||(_x[x] == null && _y[y] == null)) {
|
|
|
|
|
_x[x] = 1
|
|
|
|
|
_y[y] = 1
|
|
|
|
|
x_axis.push(x)
|
|
|
|
|
console.log([x,y])
|
|
|
|
|
return {x:x,y:y}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var serie = {label:label,data:values}
|
|
|
|
|
i = parseInt(Math.random() * (COLORS.length - 1))
|
|
|
|
|
serie.backgroundColor = 'transparent'
|
|
|
|
|
serie.borderColor = COLORS[i]
|
|
|
|
|
serie.borderColor = COLORS[10]
|
|
|
|
|
serie.borderWidth = 1
|
|
|
|
|
serie.type = 'line'
|
|
|
|
|
conf.data.datasets.push(serie)
|
|
|
|
|