How F7 introduces the statistical framework of echarts
Thanks, but I still have a question, how to import the echarts path to <template>
The previous example did not understand, is it like the require.js doing?
initialize echarts after page init, you must have the div in the dom before initializing echarts
var echarts = require('echarts');
<template>
...some code...
</template>
<script>
// initialize echarts instance with prepared DOM
var myChart = echarts.init(document.getElementById('main'));
// draw chart
myChart.setOption({
title: {
text: 'ECharts entry example'
},
tooltip: {},
xAxis: {
data: ['shirt', 'cardign', 'chiffon shirt', 'pants', 'heels', 'socks']
},
yAxis: {},
series: [{
name: 'sales',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}]
});
...more code...
</script>