Open ofir-zeitoun-ib opened 1 month ago
Monday has 0 values
if you want to 'see' zero value, then do not use barMinHeight
let's say I have values stacked of 1000 and 1, the one will not be seen. but sometimes a zero value appears in other columns
@helgasoft , that was not an answer I expected
let's say I have values stacked of 1000 and 1, the one will not be seen.
All small values will be seen if barMinHeight is set. That's the purpose of it. Demo
This confuses users to believe there is a value while its zero (on Monday in the example) if it is zero, don't show, if it is small, use barMinHeight
if it is zero, don't show, if it is small, use barMinHeight
then use color function - Demo.
nice, but still it works only on the last declaration.
see this example (I changed the demo you sent me)
itemStyle= {color: cc => {return (cc.value==0) ? 'transparent' : cc.color; }};
option = {
tooltip: { trigger: 'axis' }, legend:{},
xAxis: [
{
type: 'category',
data: ['Mon', 'Tue', 'Wed'],
axisTick: { alignWithLabel: true }
}
],
yAxis: {},
series: [
{
name: 'Direct',
type: 'bar',
stack: 'main',
barMinHeight: 4,
data: [0, 100, 1],
label:itemStyle
},
{
name: 'Direct2',
type: 'bar',
stack: 'main',
barMinHeight: 4,
data: [0, 52, 1000],
label: itemStyle
}
]
};
We have critical bug, if it help... 🙏
see deferent cases:
itemStyle= {color: cc => {return (cc.value==0) ? 'transparent' : cc.color; }};
option = {
tooltip: { trigger: 'axis' }, legend:{},
xAxis: [
{
type: 'category',
data: ['Mon', 'Tue', 'Wed'],
axisTick: { alignWithLabel: true }
}
],
yAxis: {},
// works
// series: [
// {
// name: 'Direct',
// type: 'bar',
// stack: 'main',
// barMinHeight: 4,
// data: [0, 52, 1000],
// label:{show:true}, itemStyle
// },
// {
// name: 'Direct2',
// type: 'bar',
// stack: 'main',
// barMinHeight: 4,
// data: [0, 52, 1],
// label:{show:true}, itemStyle
// }
// ],
// doesn't work (small value not on last series)
series: [
{
name: 'Direct',
type: 'bar',
stack: 'main',
barMinHeight: 4,
data: [0, 52, 1],
label:{show:true}, itemStyle
},
{
name: 'Direct2',
type: 'bar',
stack: 'main',
barMinHeight: 4,
data: [0, 52, 1000],
label:{show:true}, itemStyle
}
],
// works (reverse series)
// series: [
// {
// name: 'Direct2',
// type: 'bar',
// stack: 'main',
// barMinHeight: 4,
// data: [0, 52, 1000],
// label:{show:true}, itemStyle
// },
// {
// name: 'Direct',
// type: 'bar',
// stack: 'main',
// barMinHeight: 4,
// data: [0, 52, 1],
// label:{show:true}, itemStyle
// },
// ]
};
that's a known bug, still not fixed, see #16565 and #17005 works properly in versions V5.2.2 and below
We can't downgrade...
Version
5.4.3
Link to Minimal Reproduction
https://echarts.apache.org/examples/en/editor.html?code=PYBwLglsB2AEC8sDeAoWszGAG0iAXMmuhgE4QDmFApqYQOQCGAHhAM70A0x6xAvt3QVyAE0KoSsbNQBmYBgGYApFx6xyFABbzY9ACwrBJAEbAwmALaLDagMYwwjCNAAyjY9WyEwpAK7V-I2YAQVY2QgBtNQlJDABPEGoGW0YwagpgUjjVWNgRVMZI-gBZGC5dABV_cvoAdWoRGorNXxqAMXIagGVU7t9oegBdI0kWdgqIWwBrcTVR7EpoWogwTTcPLzJ_Odg-NT30YeI40PZI6J2wBKTdADdGbGr94iP0NloIanDYKMkYyWgjAsN3oABEIKRqLYwDlYldEgxjIxSLDJEjSMsRKsGAA2AAMNlybEc0wYFicAxGJmRxWcAAlqJRtIQ9FT0PlHJE8ZxYABWABMPP5eO5sAUClZYoAnKLxaL-cLBvsqf8SIDgQxwZDofzUSR4SD0Xr0OjMdjdPjCbFiYxSbpyc5jbB0bToAymTpWTsOYUfqKBUKRTzxZKFDLgwp5YrnocUHwANxAA&renderer=svg
Steps to Reproduce
options:
Any additional comments?
No response