antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

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

YY88Xu posted onGitHub

问题描述

<img width="1431" alt="image" src="https://github.com/antvis/G2/assets/14836228/c2ee56d2-5fb2-4085-bbef-d3fa902d9491"> 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


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests