//ny datachart1 var nychart = echarts.init(document.getelementbyid('nychart')); var option = { title: { text: 'import and export scale(10000 us dollars)' }, tooltip: { trigger: 'axis', axispointer: { // 坐标轴指示器,坐标轴触发有效 type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' }, }, toolbox: { show: true, feature: { dataview: { show: false, readonly: false }, magictype: { show: true, type: ['line', 'bar'] }, restore: { show: true }, saveasimage: { show: false } } }, legend: { data: ['import', 'export'] }, grid: { left: '0', right: '5%', bottom: '1%', containlabel: true }, xaxis: [{ type: 'category', data: ['2015', '2016', '2017', '2018', '2019', '2020', '2021'] }], yaxis: [{ type: 'value' }], series: [{ name: 'import', type: 'bar', label: { normal: { show: true, position: 'outside', } }, data: [39746.29, 44712.58, 75912.85, 53156.87, 43452.56, 70700, 97800] }, { name: 'export', type: 'bar', label: { normal: { show: true, position: 'outside', } }, data: [9179.10, 3992.62, 9313.86, 6550, 10970.86, 8100, 13200] }, ] }; nychart.setoption(option);