Skip to content
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

fix(tooltip): legendFilter and shared tooltip #5534

Merged
merged 1 commit into from
Sep 12, 2023
Merged

Conversation

pearmini
Copy link
Member

Shared Tooltip

分组条形图,点击图例筛选,会导致tooltip名称丢失:

复现代码

export function mockIntervalShared(): G2Spec {
  return {
    type: 'interval',
    data: {
      value: [
        { color: '房地产', x: '20230702', y: 36049 },
        { color: '房地产', x: '20230703', y: 26229 },
        { color: '汽车', x: '20230702', y: 23016 },
        { color: '汽车', x: '20230703', y: 48280 },
      ],
    },
    encode: { x: 'x', y: 'y', color: 'color', series: 'color' },
    legend: { color: { title: false } },
    interaction: { tooltip: { shared: true } },
  };
}

修复方法

有 shared 配置的时候都算 group items.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6156659021

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 88.481%

Totals Coverage Status
Change from base Build 6155429720: 0.003%
Covered Lines: 9964
Relevant Lines: 10898

💛 - Coveralls

@hustcc hustcc merged commit 7fc3e75 into v5 Sep 12, 2023
2 checks passed
@hustcc hustcc deleted the fix/tooltip-interval-shared branch September 12, 2023 12:05
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.

3 participants