-
我想在图表中绘制一些和axis的label有关的自定义图形,但是我找不到如何获取相关数据的方法 |
Beta Was this translation helpful? Give feedback.
Answered by
pearmini
Oct 12, 2023
Replies: 4 comments 2 replies
-
是想获取 label 的文本数据? |
Beta Was this translation helpful? Give feedback.
0 replies
-
最终目的是想获取axis的label的文本数据集合 |
Beta Was this translation helpful? Give feedback.
0 replies
-
import { LABEL_CLASS_NAME } from '@antv/g2';
chart.render(() => {
const { canvas } = chart.getContext();
const document = canvas.document;
const labels = document.getElementsByClassName(LABEL_CLASS_NAME);
// ...
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
试了一下,一个是 render没有这个回调 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
写错了:
我以为你说的 label,axis label 可以可以先获得 axis(className 就是 axis),然后打印出来,看看 children 里面 label 的 className