-
Hello folks, Could someone provide insight on how to utilize plot events provided in G2 Plot when using g2plot-react library? Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
kagawagao
Jul 15, 2021
Replies: 1 comment
-
you can use const lineChartRef = useRef<Line>();
useEffect(() => {
if (lineChartRef.current) {
const plot = lineChartRef.current;
plot.on("line:click", (e) => {
console.log(e);
});
}
}, []); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kagawagao
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can use
chartRef
to access chartplot
instance, then followg2plot
events api to bind eventdemo