Apache ECharts 5.3.0
I want to do like this https://imgur.com/a/ljTntLy (code paste in https://echarts.apache.org/examples/en/editor.html?c=bar-y-category-stack)
option = {
tooltip: {
trigger: 'item',
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value'
},
yAxis: {
type: 'category',
data: ['wn', 'req', 'quest']
},
series: [
{
type: 'bar',
stack: 'stackbar',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [{name: 'wn-1', value: 42}, 0, 0]
},
{
type: 'bar',
stack: 'stackbar',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [{name: 'wn--registr', value: 11}, 0, 0]
},
{
type: 'bar',
stack: 'stackbar',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [0, {name: 'req-sn-1', value: 38}, 0]
},
{
type: 'bar',
stack: 'stackbar',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [0, {name: 'req-sn-become', value: 7}, 0]
},
{
type: 'bar',
stack: 'stackbar',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [0, 0, {name: 'quest', value: 20}]
},
{
type: 'bar',
stack: 'stackbar',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [0, 0, {name: 'quest-2', value: 9}]
},
{
type: 'bar',
stack: 'stackbar',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [0, 0, {name: 'quest-3', value: 13}]
}
]
}
My solution is not very reliable, since I replace the data that is not needed for display with zeros (Number 0)
I need a way how can I refer the data I need to a specific yAxis column, I am using Apache Echarts along with React, but I think the solution will be universal
Please, help