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",
}]
}]
}
};
myChart = vc.plotChart('#container', opts)
}
const jdata = {
"timeseries": {
"unit": [
"secs",
"bps",
"bps",
"bps",
"bps"
],
"columns": [
"timestamp",
"Series-A",
"Series-B"
],
"values": [
[1568995200, 57, 53, 4],
[1568997000, 50, 46, 4],
[1568998800, 46, 42, 4],
[1569000600, 70, 60, 10],
[1569002400, 95, 84, 11],
[1569004200, 78, 68, 10],
[1569006000, 63, 57, 6],
[1569007800, 55, 50, 5],
[1569009600, 62, 55, 7],
[1569011400, 75, 67, 8],
[1569013200, 66, 62, 4],
[1569015000, 70, 67, 3],
[1569016800, 59, 57, 2],
[1569018600, 54, 51, 3],
[1569020400, 49, 46, 3],
[1569022200, 46, 45, 1],
[1569024000, 45, 43, 2],
[1569025800,...