echarts [Bug] multiple smooth stacked areas overlap

aor9mmx1  于 2022-11-05  发布在  Echarts
关注(0)|答案(3)|浏览(256)

Version

5.2.1

  • No response*

Steps to Reproduce

  1. option = {
  2. tooltip: {
  3. trigger: 'axis',
  4. },
  5. "legend": {
  6. },
  7. "dataset": {
  8. "source": [
  9. [
  10. "product",
  11. "a",
  12. "b",
  13. ],
  14. ["2020-10", 5.28, 0],
  15. ["2020-11", 5.72, 0],
  16. ["2020-12", 6.95, 0],
  17. ["2021-01", 8.7, 0],
  18. ["2021-02", 11.64, 0],
  19. ["2021-03", 11.93, 10.32],
  20. ["2021-04", 12.04, 6.79],
  21. ["2021-05", 10.47, 5.67],
  22. ]
  23. },
  24. "xAxis": { "type": "category",},
  25. "yAxis": {},
  26. "series": [
  27. {
  28. "type": "line",
  29. "smooth": true,
  30. "areaStyle": {},
  31. "stack": "total"
  32. },
  33. {
  34. "type": "line",
  35. "smooth": true,
  36. "areaStyle": {},
  37. "stack": "total"
  38. },
  39. ],
  40. }

Current Behavior

两条曲线的面积出现重叠。绿色曲线在圈起来的地方的值都是0,按理说不应该重叠

Expected Behavior

两条曲线的面积

Environment

  1. - OS: mac osx
  2. - Browser: chrome
  3. - Framework: vue

Any additional comments?

  • No response*
u3r8eeie

u3r8eeie1#

删除 stack: 'total' 配置项再看看是不是你想要的?

lnxxn5zx

lnxxn5zx2#

删除 stack: 'total' 配置项再看看是不是你想要的?

这个不行,其实我想同时实现堆叠和smooth的效果,

h79rfbju

h79rfbju3#

似乎是平滑计算导致的问题,试试设置 smoothMonotonex

相关问题