antvis / G2Plot

:dango: An interactive and responsive charting library based on G2.
https://g2plot.antv.antgroup.com
MIT License
2.56k stars 607 forks source link

子弹图组件设置legend: false; 但是图例不关闭,显示title #3712

Open 97702573 opened 11 months ago

97702573 commented 11 months ago

最新版本的@antv/g2plot的Bullet组件

97702573 commented 11 months ago

import React from 'react'; import ReactDOM from 'react-dom'; import { Bullet } from '@ant-design/plots';

const DemoBullet = () => { const data = [ { title: '5🌟', ranges: [100, 80], measures: [50, 40], targets: [85], }, { title: '4🌟', ranges: [100, 10], measures: [12, 40], targets: [40, 70], }, { title: '3🌟', ranges: [100], measures: [20], targets: [22], }, { title: '0-2🌟', ranges: [100], measures: [30], targets: [10], }, ];

const color = { ranges: ['#FFbcb8', '#FFe0b0', '#bfeec8'], measures: ['#5B8FF9', '#61DDAA'], targets: ['#f0f'], };

const config = { data, color };

return <Bullet {...config} />; };

ReactDOM.render(, document.getElementById('container')); 如何关闭图例