Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.title = '堆叠条形图';
- option = {
- tooltip : {
- trigger: 'axis',
- axisPointer : { // 坐标轴指示器,坐标轴触发有效
- type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- legend: {
- data: ['day1', 'day2','day3', 'month1','month2','month3','month4', 'year1', 'year2']
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: {
- type: 'category',
- data: ['1','2','3']
- },
- yAxis: {
- type: 'value'
- },
- series: [
- {
- name: 'year1',
- type: 'bar',
- stack: 'year',
- label: {
- normal: {
- show: true,
- position: 'insideRight'
- }
- },
- data: [320, 302, 301]
- },
- {
- name: 'year2',
- type: 'bar',
- stack: 'year',
- label: {
- normal: {
- show: true,
- position: 'insideRight'
- }
- },
- data: [320, 302, 301]
- },
- {
- name: 'day1',
- type: 'bar',
- stack: 'day',
- label: {
- normal: {
- show: true,
- position: 'insideRight'
- }
- },
- data: [320, 302, 301]
- },
- {
- name: 'month1',
- type: 'bar',
- stack: 'month',
- label: {
- normal: {
- show: true,
- position: 'insideRight'
- }
- },
- data: [303, 302, 301]
- },
- {
- name: 'month2',
- type: 'bar',
- stack: 'month',
- label: {
- normal: {
- show: true,
- position: 'insideRight'
- }
- },
- data: [303, 302, 301]
- },
- {
- name: 'month3',
- type: 'bar',
- stack: 'month',
- label: {
- normal: {
- show: true,
- position: 'insideRight'
- }
- },
- data: [303, 302, 301]
- },
- {
- name: 'month4',
- type: 'bar',
- stack: 'month',
- label: {
- normal: {
- show: true,
- position: 'insideRight'
- }
- },
- data: [503, 702, 101]
- },
- {
- name: 'day2',
- type: 'bar',
- stack: 'day',
- label: {
- normal: {
- show: true,
- position: 'insideRight'
- }
- },
- data: [120, 132, 101]
- },
- {
- name: 'day3',
- type: 'bar',
- stack: 'day',
- label: {
- normal: {
- show: true,
- position: 'insideRight'
- }
- },
- data: [220, 182, 191]
- }
- ]
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement