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

怎么设置 elementHighlight 的背景色呢? #6073

Open
YY88Xu opened this issue Jan 30, 2024 · 0 comments
Open

怎么设置 elementHighlight 的背景色呢? #6073

YY88Xu opened this issue Jan 30, 2024 · 0 comments

Comments

@YY88Xu
Copy link

YY88Xu commented Jan 30, 2024

问题描述

image import { Chart } from '@antv/g2';

const data = [
{ year: '1951 年', sales: 38 },
{ year: '1952 年', sales: 52 },
{ year: '1956 年', sales: 61 },
{ year: '1957 年', sales: 145 },
{ year: '1958 年', sales: 48 },
{ year: '1959 年', sales: 38 },
{ year: '1960 年', sales: 38 },
{ year: '1962 年', sales: 38 },
];

const chart = new Chart({
container: 'container',
autoFit: true,
});

chart.interval().data(data).encode('x', 'year')
.encode('y', 'sales')
.interaction('elementHighlight',
{
background: true,
backgroundFill: 'red', // 这里
})

chart.render();

重现链接

No response

重现步骤

No response

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

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

No branches or pull requests

1 participant