I installed using NPM, echarts library in this way
npm install echarts --save
Following the documentation I wrote in my code
import * as echarts from 'echarts'
then I tried a very simple example
const $chart = $('#chart')
let myChart = echarts.init($chart)
const option = {
title: {
text: 'ECharts entry example'
},
tooltip: {},
legend: {
data: ['Sales']
},
xAxis: {
data: ['shirt', 'cardign', 'chiffon shirt', 'pants', 'heels', 'socks']
},
yAxis: {},
series: [
{
name: 'Sales',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}
]
}
myChart.setOption(option)
but I got this error
ReferenceError: __DEV__ is not defined
What do you think is the problem? I can't find documentation about this error...
This worked for me (echarts 4.2.1): import * as echarts from 'echarts';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With