apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.69k stars 19.62k forks source link

[Bug] (type: line,stack: Total) When a line has a large Y-axis value, the other lines are incorrectly displayed too high #20512

Closed liasece closed 1 week ago

liasece commented 1 week ago

Version

5.5.1

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=line-stack&code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcya6GOAHmAQOQDKYAhgMYDWOAJrADITQ6VEC-AGiJhgwLJBAFUxDACcIAc0U45VOqQgBnPuiFFcK6K2lF0rOvQIBtSgFEAtnQhZKg2JQCq0KHACCrDrulABqEKw4wLABQR4AIhByOAxgbh7UOHRyDAAWsHbQity8ALoCwuiKCiaEsrgAZhQeAMwApG5msAqKOU2UACztFcQARsBgog5UbR2yDDD03Bx0IzhYBGByAK445SJiWGOkprL1mWBbSSeysFp0AG44floAkk4q0vydX3rDpH6aLTXdBgACeIHwHgYlhwimAclBs1GwC2xiyoIA4nQpLB6nQsFocMNzJY6DZKABZGBpSgAFR2NIA6mwabSclsaQAxBQ06iWXmoyhlX5EUEA7TAjDgyGUe74hl7dCEhQ4IGwaydGQ3aB0BwysIRKIxJGyMEQqhYYom4haejMKi08b460kqzqgCMAFYAAzuABMzT9_u97u9vtgXv67ndAE5w81muH-qHhcR9LItbIdXqqBksrl8oUrcTiGaZZaeC7bnamA6na4S66yeqABx-8MxwPuDvNKMRv1x6MJ8PuwPe1N6IhlfgAbiAA

Steps to Reproduce

option = {
  title: {
    text: 'Stacked Line'
  },
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  toolbox: {
    feature: {
      saveAsImage: {}
    }
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      name: 'Video Ads',
      type: 'line',
      stack: 'Total',
      data: [150, 232, 20100, 154, 190, 330, 410]
    },
    {
      name: 'Search Engine',
      type: 'line',
      stack: 'Total',
      data: [820, 932, 0, 934, 1290, 1330, 1320]
    }
  ]
};

Current Behavior

image

Expected Behavior

The green line should be at y=0 at x=Wed.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

MatthiasMert commented 1 week ago

You are stacking the lines in which the order of series matters. Currently you are stacking a value of 0 on top of the first line. Since your first line has a value of 20100, the second line has a value of 20100 + 0. Here is your example with changed order.