如何将输入数据axisx和axisy更改为axisx数组或axisy数组,从输入数据[x1,x1],[x2,y2],[x3,y3]到[x1,x2,x3]和[y1,y2 ,y3]。它与axisy或axisx的技巧无关。
请查看折线图的输入数据。它的axisy数据是u=[100,35,35,30,105,40,35,30,40,20,15]。
function d(k) {
var n = [];
for(var e = 0; e <= 10; e += 1) {
n.push([e, parseInt(Math.random() * 30)])
}
var m = [];
for(var e = 0; e <= 10; e += 1) {
m.push([e, parseInt(Math.random() * 30)])
}
var j = [];
for(var e = 0; e <= 10; e += 1) {
j.push([e, parseInt(Math.random() * 30)])
}
var l = {
series: {
stack: true,
bars: {
show: true,
barWidth: 0.4
}
},
grid: {
borderWidth: 0
}
};
a.plot(k, [{
data: n,
color: "#E15656"
}, {
data: m,
color: "#A6D037"
}, {
data: j,
color: "#61A5E4"
}], l)
}