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
背景:需要灵活设置X轴标签位置,当标签设置在图形内时,标签会被图形覆盖(如下图) 对应配置:
import { Chart } from '@antv/g2'; const data = [ { year: '1991', value: 3 }, { year: '1992', value: 4 }, { year: '1993', value: 3.5 }, { year: '1994', value: 5 }, { year: '1995', value: 4.9 }, ]; const chart = new Chart({ container: 'container', autoFit: true, height: 500, }); chart.data(data); chart.tooltip({ showMarkers: false }); chart .interval() .position('year*value') .color('year'); // 设置X轴位置偏移 chart.axis('year',{ label:{ offset: -15, style:{ fill: '#000' }, }, }) chart.interaction('element-highlight'); chart.interaction('element-list-highlight'); chart.interaction('legend-highlight'); chart.interaction('axis-label-highlight'); chart.render();
期望解决方案:提供控制层叠循序的配置
The text was updated successfully, but these errors were encountered:
为什么希望 x 轴标签展示在上方呢?可以看下你的原始诉求,提供其它的建议方案。
目前绘图层有三层:backgroundGroup、middleGroup、foreGroup(axis 等组件是属于 backgroundGroup 的,element 等图形元素是在 middleGroup)依次展示。目前应该是不允许去调整这三层的顺序的。
Sorry, something went wrong.
我的原始诉求是想灵活设置X轴标签位置,主要位置有三种:图形内部、图形上方、X轴下方(默认)
在 4.x 中很难处理,在 G2 5.0 中可以通过 spec 顺序来决定。
No branches or pull requests
What problem does this feature solve?
背景:需要灵活设置X轴标签位置,当标签设置在图形内时,标签会被图形覆盖(如下图)
对应配置:
期望解决方案:提供控制层叠循序的配置
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: