We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
分组柱线图表-显示多折线 进行tooltip 的回调设置,宽度不能自适应(除首次渲染)
图表宽度可以自适应
import { DualAxes } from '@ant-design/plots'; import React,{useState} from 'react'; import ReactDOM from 'react-dom'; import { Button, Form, Modal, Select, Space, Spin, Tooltip } from 'antd'; const DemoDualAxes = () => { const uvBillData = [ { time: '2019-03', value: 350, type: 'uv' }, { time: '2019-04', value: 900, type: 'uv' }, { time: '2019-05', value: 300, type: 'uv' }, { time: '2019-06', value: 450, type: 'uv' }, { time: '2019-07', value: 470, type: 'uv' }, { time: '2019-03', value: 220, type: 'bill' }, { time: '2019-04', value: 300, type: 'bill' }, { time: '2019-05', value: 250, type: 'bill' }, { time: '2019-06', value: 220, type: 'bill' }, { time: '2019-07', value: 362, type: 'bill' }, ]; const transformData = [ { time: '2019-03', count: 800, name: 'a' }, { time: '2019-04', count: 600, name: 'a' }, { time: '2019-05', count: 400, name: 'a' }, { time: '2019-06', count: 380, name: 'a' }, { time: '2019-07', count: 220, name: 'a' }, { time: '2019-03', count: 750, name: 'b' }, { time: '2019-04', count: 650, name: 'b' }, { time: '2019-05', count: 450, name: 'b' }, { time: '2019-06', count: 400, name: 'b' }, { time: '2019-07', count: 320, name: 'b' }, { time: '2019-03', count: 900, name: 'c' }, { time: '2019-04', count: 600, name: 'c' }, { time: '2019-05', count: 450, name: 'c' }, { time: '2019-06', count: 300, name: 'c' }, { time: '2019-07', count: 200, name: 'c' }, ]; const [open,setOpen]=useState(false) const config = { xField: 'time', children: [ { data: uvBillData, type: 'interval', yField: 'value', colorField: 'type', group: true, style: { maxWidth: 80 }, interaction: { elementHighlightByColor: { background: true } }, }, { data: transformData, type: 'line', yField: 'count', colorField: 'name', style: { lineWidth: 2 }, axis: { y: { position: 'right' } }, scale: { series: { independent: true } }, }, ], tooltip: ( d, ) =>({ name: d.leftSplitField, value:d.value, field:'value', }), }; return<div> <Button onClick={()=>setOpen(true)}>打开</Button> <Modal open={open} centered footer={null} onCancel={() => setOpen(false) } width="50%" > <DualAxes {...config} /> </Modal> </div>; }; ReactDOM.render(<DemoDualAxes />, document.getElementById('container'));
最新版
The text was updated successfully, but these errors were encountered:
No branches or pull requests
🐛 bug 描述 [详细地描述 bug,让大家都能理解]
分组柱线图表-显示多折线 进行tooltip 的回调设置,宽度不能自适应(除首次渲染)
📷 复现步骤 [清晰描述复现步骤,让别人也能看到问题]
🏞 期望结果 [描述你原本期望看到的结果]
图表宽度可以自适应
💻 复现代码 [提供可复现的代码,仓库,或线上示例]
© 版本信息
最新版
🚑 其他信息 [如截图等其他信息可以贴在这里]
The text was updated successfully, but these errors were encountered: