I'm testing Echarts capabilities on its demo page: https://ecomfe.github.io/echarts-examples/public/editor.html?c=line-simple
Now I want that chart to display data gathered from a URL. That URL returns "[820, 932, 901, 934, 1290, 1330, 1320]".
Demo code (which is working) is:
option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line'
}]
};
My code (which is NOT working) is:
option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [{
url: 'https://www.myurl.com/echartstest.php',
type: 'line'
}]
};
When I use my URL inside the code, no error is returned, but the chart is not being displayed.
If necessary I can use AJAX in my project.