echarts 显示顺序_解决echarts的stack堆积柱状图顺序反的问题

  • Post author:
  • Post category:其他


第一个 ECharts 实例

// 基于准备好的dom,初始化echarts实例

var myChart1 = echarts.init(document.getElementById(‘demo1’));

var myChart2 = echarts.init(document.getElementById(‘demo2’));

// demo 1

var option1 = {

title: {

text: ”,

textStyle: {

color: ‘#464646’, fontWeight: ‘normal’, fontSize: 18

}

},

grid: {

top: 140, right: 20, bottom: 0, left: 20, containLabel: true

},

legend: {

top: 30,

left: ‘center’,

textStyle: {

fontSize: 14,

padding: [0, 10, 0, 0]

},

data: [

{ name: ‘2021-Scope 1-Direct emissions and removals’, icon: ‘rect’ },

{ name: ‘2021-Scope 2 – Energy indirect emissions’, icon: ‘rect’ },

{ name: ‘2021-Intensity’, icon: ‘circle’ },

{ name: ‘2020-Scope 1-Direct emissions and removals’, icon: ‘rect’ },

{ name: ‘2020-Scope 2 – Energy indirect emissions’, icon: ‘rect’ },

{ name: ‘2020-Intensity’, icon: ‘circle’ },

{ name: ‘2019-Scope 1-Direct emissions and removals’, icon: ‘rect’ },

{ name: ‘2019-Scope 2 – Energy indirect emissions’, icon: ‘rect’ },

{ name: ‘2019-Intensity’, icon: ‘circle’ }

]

},

tooltip: {},

toolbox: {

feature: {}

},

xAxis: {

type: ‘category’,

data: [‘Transportation and logistics’, ‘Engineering and construction’, ‘Real estate’], axisLabel: { fontSize: 14 },

// inverse: true

},

yAxis: [

{

name: ‘Tonne CO2e’,

type:



版权声明:本文为weixin_40000702原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。