Skip to content

feat(图表): 支持堆叠面积图 #16440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025
Merged

Conversation

wisonic-s
Copy link
Contributor

What this PR does / why we need it?

Summary of your change

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@@ -628,7 +626,7 @@ export class Line extends G2ChartView {
g2TooltipWrapper.style.zIndex = '9999'
document.body.appendChild(g2TooltipWrapper)
}
const lineMark = options.children[0]
const yAxis = chart.yAxis
const tooltipOptions: G2Spec = {
tooltip: d => d,
interaction: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码片段中存在一些问题和潜在的问题:

  1. 标签配置:

    • configLabel 方法中,如果属性 basicStyle 不在 labelAttr 中(可能是因为旧的版本),会导致未定义错误。
    • 如果 labelAttr.showfalse,直接返回 options 而不是将 custom.attr.tooltip 设为空。
  2. 提示框配置:

    • configTooltip 方法中,tooltip 是否显示由 show 属性决定,而不是 chart.yAxisline.mark.
    • 对于 tooltip 的默认值设置,在不同的地方有不同的处理方式,可能需要统一规范化。例如:
      defaultsDeep(lineMark, { tooltip: false })
  3. 数据格式化:

    • 数据对象字段 EXTREMEvalue 都应被检查其是否存在或是否满足条件。
    • 在极端条件下如数据缺失时,应该提供更智能的提示机制。
  4. Z轴调整:

    • 尽管提到要设置 tooltip 样式层级较高,但实际上并没有实现该功能。

建议修改上述代码,确保结构清晰、逻辑合理,并且避免潜在的安全性和性能隐患。

@wisonic-s wisonic-s merged commit 7c8827c into dev-v3 Jun 30, 2025
3 of 4 checks passed
@wisonic-s wisonic-s deleted the pr@dev-v3@feat_area_stack branch June 30, 2025 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants