JavaScript
function drawLineAreaChart() {
console.log(jdata)
var opts = {
chart: {
heading: "Timeseries",
chartIndex: 2,
//width: 800,
height: 270,
margin: {
top: 40,
right: 15,
bottom: 50,
left: 15
},
chartResize: true,
chartType: "timeseries"
},
data: jdata,
xAxis: {
bottom: {
label: 'Time',
tickNumber: 5,
}
},
yAxis: {
left: {
unit: 'Count',
tickNumber: 5,
label: 'Count',
format(d) { // Format all series belong to this Y Axis
return d
}
}
},
zoom: {
visible: true,
onXZoom(st, et) {
console.log('im x zoom', st, et)
}
},
series: {
line: [{
name: 'Series-A',
color: "#386CB0",
lineWidth: '2px',
plotAxis: ["left", "bottom"]
}],
stack: [{
name: 'StackGroup', // Name of stack
plotAxis: ["left", "bottom"], // Define its axis dependency for all below defined series
stackOrderMembers: [{
name: 'Series-B',
color: "#990506",
}, {
name: 'Series-C',
color: "#368669",
lineWidth: '2px',
plotAxis: ["left", "bottom"]
}]
}]
}
};
myChart = vc.plotChart('#container', opts)
}
const jdata = {
"timeseries": {
"unit": [
"secs",
"bps",
"bps",
"bps",
"bps"
],
"columns": [
"timestamp",
"Series-A",
"Series-B",
"Series-C"
],
"values": [
[1568995200, 60, 53, 4],
[1568997000, 70, 46, 4],
[1568998800, 66, 42, 4],
[1569000600, 80, 60, 10],
[1569002400, 99, 84, 11],
[1569004200, 88, 68, 10],
[1569006000, 93, 57, 6],
[1569007800, 85, 50, 5],
[1569009600, 62, 55, 7],
[1569011400, 75, 67, 8],
[1569013200, 66, 62, 4],
[1569015000, 90, 67, 3],
[1569016800, 59,...