Home > front end >  Echarts stacked bar chart
Echarts stacked bar chart

Time:12-05

 
Optiondd={
Title: {
Text: 'test',
X: 'LEFT'
},
Tooltip: {
The trigger: 'axis',
AxisPointer: {
Type: 'shadow'
}
},
The grid: {
Left: '3%',
Right: '4%',
Bottom: '3%',
ContainLabel: true
},
XAxis: [{
Type: 'category',
Data: [' a branch ', '2 branches',' three branch ', 'four branch', 'fifth precinct', 'six branches',' seven branches']
},
YAxis: [{
Type: 'value'
},
Series: [{
Name: 'in use (desktop),
Type: 'bar',
Stack: 'desktop',
BarWidth: 15,
Data: [300, 32, 100, 300, 90, 300, 30]
},
{
Name: 'has been scrapped,
Type: 'bar',
Stack: 'desktop',
BarWidth: 15,
Data: [100, 0, 150, 0, 190, 0, 230]
},
{
Name: 'scrap in use'
Type: 'bar',
Stack: 'desktop',
Data: [20, 300, 300, 34, 300, 30, 290],
Label: {
Show: true,
Position: 'top',
Color: black,
The formatter: function (params) {
Value
return params.}
}
},
{
Name: 'in use'
Type: 'bar',
Stack: 'laptop',
BarWidth: 15,
Data: [120, 132, 101, 134, 90, 230, 210]
},
{
Name: 'scrap in use'
Type: 'bar',
Stack: 'laptop',
Data: [0, 182, 191, 234, 290, 330, 0]
},
{
Name: 'scrap for disposal,
Type: 'bar',
Stack: 'laptop',
Data: [150, 0, 201, 154, 190, 0, 410],
Label: {
Show: true,
Position: 'top',
Color: black,
The formatter: function (params) {
Value
return params.}
}
},
{
Name: 'in use'
Type: 'bar',
BarWidth: 15,
Stack: 'printer',
Data: [620, 732, 701, 734, 1090, 1130, 1120]
},
{
Name: 'scrap in use'
Type: 'bar',
Stack: 'printer',
Data: [120, 132, 0, 134, 0, 0, 220]
},
{
Name: 'scrap for disposal,
Type: 'bar',
Stack: 'printer',
Data: [60, 72, 0, 0, 190, 0, 0]
},
{
Name: 'unallocated'
Type: 'bar',
Stack: 'printer',
Data: [0, 0, 91, 0, 0, 0, 120],
Label: {
Show: true,
Position: 'top',
Color: black,
The formatter: function (params) {
Value
return params.}
}
}
]
};


Hope that in the top of each column or tooltip shows the total number of each column,

CodePudding user response:

According to the statistical data stack first, and then in the label of the formatter to obtain statistical data

CodePudding user response:


What statistical data, how to statistical how
  • Related