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
当给双轴图设置slider后, 如果删除slider属性,slider仍然会展示,必须显式设置slider=false才能隐藏。 1.x 版本/ 2.x版本都有该问题。
第一步, 设置config如下
const config = { data: [], // ...其他属性 slider: { start: 0, end: 0 }, }
第二步, 删除config中slider属性,然后发现双轴图slider仍然展示;
当去掉slider属性后自动隐藏slider,而不是显式传false
import React, { useState, useEffect } from 'react'; import ReactDOM from 'react-dom'; import { DualAxes } from '@ant-design/plots'; const DemoDualAxes = () => { const [sliderConfig, setSliderConfig] = useState({ slider: { start: 0, end: 1, }, }) const data = [ { time: '2019-03', value: 350, count: 800, }, { time: '2019-04', value: 900, count: 600, }, { time: '2019-05', value: 300, count: 400, }, { time: '2019-06', value: 450, count: 380, }, { time: '2019-07', value: 470, count: 220, }, ]; const config = { data: [data, data], xField: 'time', yField: ['value', 'count'], ...sliderConfig, geometryOptions: [ { geometry: 'column', }, { geometry: 'line', lineStyle: { lineWidth: 2, }, }, ], }; const onHideSlider = () => { setSliderConfig({}) }; return <> <button onClick={onHideSlider}>隐藏slider</button> <DualAxes {...config} /> </>; }; ReactDOM.render(<DemoDualAxes />, document.getElementById('container'));
The text was updated successfully, but these errors were encountered:
试一下设置为false
Sorry, something went wrong.
No branches or pull requests
🐛 bug 描述 [详细地描述 bug,让大家都能理解]
当给双轴图设置slider后, 如果删除slider属性,slider仍然会展示,必须显式设置slider=false才能隐藏。 1.x 版本/ 2.x版本都有该问题。
📷 复现步骤 [清晰描述复现步骤,让别人也能看到问题]
第一步, 设置config如下
第二步, 删除config中slider属性,然后发现双轴图slider仍然展示;
🏞 期望结果 [描述你原本期望看到的结果]
当去掉slider属性后自动隐藏slider,而不是显式传false
💻 复现代码 [提供可复现的代码,仓库,或线上示例]
© 版本信息
🚑 其他信息 [如截图等其他信息可以贴在这里]
The text was updated successfully, but these errors were encountered: