echarts [Bug] Group Connect - Tooltip is not being triggered when graph contains series.lines with a few points also series.candlestick

vqlkdk9b  于 8个月前  发布在  Echarts
关注(0)|答案(2)|浏览(223)

Version

5.3.2

https://codepen.io/gabrielkantox/pen/QWmNdQR

Steps to Reproduce

  1. var chart1 = echarts.init(document.getElementById("chart1"));
  2. var option1 = {
  3. title: {
  4. text: "chart1"
  5. },
  6. tooltip: {
  7. trigger: "axis"
  8. },
  9. legend: {
  10. data: ["Forecast 1", "Forecast 2", "Forecast 3", "Forecast 4"]
  11. },
  12. xAxis: {
  13. data: ["21-01-2022", "22-01-2022", "23-01-2022", "24-01-2022", "25-01-2022", "26-01-2022", "27-01-2022"]
  14. },
  15. yAxis: {},
  16. series: [
  17. {
  18. name: "Rates",
  19. type: "candlestick",
  20. data: [[5.1,9,4,10], [3,8,2,9]],
  21. },
  22. {
  23. name: "Forecast 1",
  24. type: "line",
  25. data: [["21-01-2022", 10], ["22-01-2022", null], ["23-01-2022", 20], ["24-01-2022", 13], ["25-01-2022", null], ["26-01-2022", null], ["27-01-2022", null]],
  26. },
  27. {
  28. name: "Forecast 2",
  29. type: "line",
  30. data: [["26-01-2022", 14], ["27-01-2022", 16]],
  31. },
  32. {
  33. name: "Forecast 3",
  34. type: "line",
  35. data: [["24-01-2022", 14], ["25-01-2022", 16]],
  36. },
  37. {
  38. name: "Forecast 4",
  39. type: "line",
  40. data: [["21-01-2022", 2], ["22-01-2022", 4], ["23-01-2022", 6], ["24-01-2022", 12], ["25-01-2022", 24], ["26-01-2022", 26], ["27-01-2022", 30]],
  41. },
  42. ]
  43. };
  44. var chart2 = echarts.init(document.getElementById("chart2"));
  45. var option2 = {
  46. title: {
  47. text: "chart2"
  48. },
  49. tooltip: {
  50. trigger: "axis"
  51. },
  52. legend: {
  53. data: ["Forecast Total", "Forecast ENUM", "Orders"]
  54. },
  55. xAxis: {
  56. data: ["21-01-2022", "22-01-2022", "23-01-2022", "24-01-2022", "25-01-2022", "26-01-2022", "27-01-2022"]
  57. },
  58. yAxis: [{}],
  59. series: [
  60. {
  61. z: -1,
  62. data: [["21-01-2022", 1], ["22-01-2022", 2], ["23-01-2022", 3], ["24-01-2022", 4], ["25-01-2022", 5], ["26-01-2022", 6], ["27-01-2022", 7]],
  63. name: 'Orders',
  64. type: 'line',
  65. emphasis: {
  66. disabled: true
  67. },
  68. coordinateSystem: 'cartesian2d',
  69. areaStyle: {
  70. color: "#CAF2FE"
  71. },
  72. symbol: 'circle',
  73. showSymbol: false,
  74. step: 'end',
  75. color: '#CAF2FE',
  76. },
  77. {
  78. name: "Forecast Total",
  79. type: "line",
  80. data: [["21-01-2022", 10], ["22-01-2022", 35], ["23-01-2022", 20], ["24-01-2022", 13], ["25-01-2022", 12], ["26-01-2022", 18], ["27-01-2022", 41]]
  81. }
  82. ],
  83. dataZoom: [
  84. { yAxisIndex: 0, filterMode: "none" }
  85. ]
  86. };
  87. chart1.setOption(option1);
  88. chart2.setOption(option2);
  89. chart1.group = "group1";
  90. chart2.group = "group1";
  91. echarts.connect("group1");

Current Behavior

When the user mouse over the second chart it doesn't display the tooltip on the first:
The tooltip also gets lost (wrong position) in some cases

Expected Behavior

When the user mouse over a point on the second chart it should display the tooltip point on the first chart.

Environment

  1. - OS: macOS Monterey
  2. - Browser: Google Chrome Version 99.0.4844.74 (Official Build) (x86_64)
  3. - Framework: EmberJS 3.28.8

Any additional comments?

I removed line by line to see if I can figure out the issue but it happens in multiples cases.

  1. With candlestick and series.line incomplete
  2. With only series lines and 1 of them incomplete
sdnqo3pr

sdnqo3pr1#

how to fix it?

u7up0aaq

u7up0aaq2#

I'm facing this issue as well

相关问题