1
var echartLine = echarts.init(document.getElementById('echart_line'), theme);
echartLine.setOption({
title: {
text: 'Line ',
subtext: 'Mes'
},
tooltip: {
trigger: 'axis'
},
legend: {
x: 220,
y: 40,
data: ['actions1', 'actions2', 'actions3']
},
toolbox: {
show: true,
feature: {
magicType: {
show: true,
title: {
line: 'Line',
bar: 'Bar',
stack: 'Stack',
tiled: 'Tiled'
},
type: ['line', 'bar', 'stack', 'tiled']
},
restore: {
show: true,
title: "Restore"
},
saveAsImage: {
show: true,
title: "Save Image"
}
}
},
calculable: true,
xAxis: [{
type: 'category',
boundaryGap: false,
// scale:true,
// splitNumber:12,
data: ['Mon', Tue', 'Wed', 'Thu', 'Fri'] //Quero receber aqui em JSON
}],
yAxis: [{
type: 'value'
}],
series: [{
name: 'stuff',
type: 'line',
smooth: true,
itemStyle: {
normal: {
areaStyle: {
type: 'default'
}
}
},
data: [10, 12, 21, 54, 260, 830, 710] // Quero receber aqui em JSON
}, {
name: 'stuff',
type: 'line',
smooth: true,
itemStyle: {
normal: {
areaStyle: {
type: 'default'
}
}
},
data: [30, 182, 434, 791, 390, 30, 10]
}, {
name: 'things',
type: 'line',
smooth: true,
itemStyle: {
normal: {
areaStyle: {
type: 'default'
}
}
},
data: [1320, 1132, 601, 234, 120, 90, 20]
}]
});
How can I get my "data" array of PHP querys to make my chart dynamic? I am in urgent need of help. So far I have not used JSON. Thank you
Welcome to Stackoverflow Andre. Please always put the code directly in your answer, rather than putting a link with the solution, because if in the future the link breaks, your answer will no longer be useful to the community.
– Pedro Gaspar
Whoa, what’s up, Andre? It would be interesting to explain a little about the operation and how to use in your reply, leaving only the link can leave your answer vague in the future when that link ceases to exist.
– David Alves