I am trying a flot charts with data
[[1645570986, 0.4624863055203449], [1645570987, 0.4624863055203449], [1645570988, 0.468952235505014],…]
therefore [timespamp, value], however, the time does not appear in the x axis.
Anyone can give me some advice.
function CF_real_CPU(){
'use strict';
var cpu = $.plot('#flotRealtime1', [real[0].data], {
colors: ['#ff5e5e'],
series: {
lines: {
show: true,
lineWidth: 1
},
shadowSize: 0 // Drawing is faster without shadows
},
grid: {
borderColor: 'transparent',
borderWidth: 1,
labelMargin: 5
},
xaxis: {
mode: "time",
tickSize: [10, "second"],
tickLength: 10,
axisLabelUseCanvas: true,
axisLabelPadding: 10,
color: "transparent",
font: {
size: 10,
color: "#fff"
}
},
yaxis: {
color: 'transparent',
font: {
size: 10,
color: '#fff'
}
}
});
}
Thank you
alby696
Your timestamp are in seconds. When using Flot (and JavaScript in general) they need to be in milliseconds.
1645570987needs to be1645570987000and so on.With the timestamps as they are now, all your data spans less than one second, so the time on the axis is outside the vissible area.