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
代码如下:
import { Chart } from '@antv/g2'; const data = [ { type: '未知', value: -10, percent: 0.02 }, { type: '17 岁以下', value: -20, percent: 0.02 }, { type: '18-24 岁', value: -30, percent: 0.2 }, { type: '25-29 岁', value: -40, percent: 0.24 }, ]; const chart = new Chart({ container: 'container', autoFit: true, height: 500, padding: [50, 20, 50, 20], }); chart.data(data); chart.scale('value', { alias: '销售额(万)', }); chart.axis('type', { tickLine: { alignTick: false, }, }); chart.tooltip({ showMarkers: false, }); chart.interval().position('type*value'); chart.interaction('element-active'); chart.scale('value', { max: -50 }); chart.render();
设置比例尺的最大值为 -50,预期情况是,什么都不显示,因为所有值都比 -50 大,就像这样: 然而官网复现出来,是这样: 看起来只隐藏了第一个数据,其他的没反应。
The text was updated successfully, but these errors were encountered:
max min 都会和具体的数据进行比较之后再做处理。如果强制按照用户设置的来处理,那就用这个:
chart.scale('value', { maxLimit: -50, // 👈🏻 // minLimit: 10, });
Sorry, something went wrong.
感谢,确实有效
No branches or pull requests
代码如下:
设置比例尺的最大值为 -50,预期情况是,什么都不显示,因为所有值都比 -50 大,就像这样:
然而官网复现出来,是这样:
看起来只隐藏了第一个数据,其他的没反应。
The text was updated successfully, but these errors were encountered: