Open liuqituo opened 1 year ago
It seems that echarts computes the stacked series from the data point of the previous stack and doesnt take the visual minimum height into account (which is the correct way in my opinion). The bars just overlap because the difference between them is smaller than 1 pixel on the yAxis and thus cannot be displayed. Here is an example which illustrates this nicely.
As a solution to your problem I would suggest using axis type 'log'. Here is an example.
everyone be careful using stacked bars with log scale - see example in #18330
It seems that echarts computes the stacked series from the data point of the previous stack and doesnt take the visual minimum height into account (which is the correct way in my opinion). The bars just overlap because the difference between them is smaller than 1 pixel on the yAxis and thus cannot be displayed. Here is an example which illustrates this nicely.
As a solution to your problem I would suggest using axis type 'log'. Here is an example.
Sorry, but I am using Echarts to do large screen projects, we will support users to configure a lot of Echarts configuration, including the type of Y axis (can choose value or log), if the user wants to configure the type of Y axis as 'value', There seems to be no way to fix this problem by setting it to log
everyone be careful using stacked bars with log scale - see example in #18330
Sorry, but I am using Echarts to do large screen projects, we will support users to configure a lot of Echarts configuration, including the type of Y axis (can choose value or log), if the user wants to configure the type of Y axis as 'value', There seems to be no way to fix this problem by setting it to log
Version
5.4.3
Link to Minimal Reproduction
https://echarts.apache.org/examples/zh/editor.html?c=line-simple(The simplest line chart example on the official website can be)
Steps to Reproduce
code: const colors = ['#5470C6', '#91CC75', '#EE6666']; option = { legend: { data: ['Evaporation', 'Precipitation', 'Temperature'] }, xAxis: [ { type: 'category', axisTick: { alignWithLabel: true }, // prettier-ignore data: ['Jan', 'Feb'] } ], yAxis: [ { type: 'value', show: false, name: '温度', position: 'left', }, ], series: [ { name: 'Evaporation', type: 'bar', stack:'total', barMinHeight:10, data: [ 2.0, 4.9 ] }, { name: 'Precipitation', type: 'bar', stack:'total', barMinHeight:10, data: [ 2.6, 5.9 ] }, { name: 'Temperature', type: 'line', stack:'total', data: [20000, 20000] } ] };
Current Behavior
The minimum height set for the bar appears to be invalid, or in effect, but one is obscured
Expected Behavior
Hopefully, the minimum height of the two bars is set so that both can be seen and will not block each other
Environment
Any additional comments?
No response