Skip to content
New issue

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

[proposal] can we add links in pie-chart graphs in the legend section #382

Open
1 task
sudip10028 opened this issue Feb 1, 2024 · 1 comment
Open
1 task
Labels
question Further information is requested

Comments

@sudip10028
Copy link

Describe your proposal

In my usecase i want to add a custom link in every legend so that clicking on the hyperlink any one can be routed to a specific pages.

What the feature/improvement it should looks like?

.

Other information

No response

Willing to implement it?

  • Yes, I do
@sudip10028 sudip10028 added the enhancement New feature or request label Feb 1, 2024
@Koooooo-7
Copy link
Member

Hi @sudip10028 , I think you can register the event listener to achieve this on js level such as windows.open, more event type see events.

	pie := charts.NewPie()
	const handler = `
   (params) => {
      // I get the legend selected event in Console now
      console.log(params);
   }
`
	pie.SetGlobalOptions(
		charts.WithTitleOpts(opts.Title{Title: "label options"}),
		charts.WithEventListeners(event.Listener{
			EventName: "legendselectchanged",
			Handler:   opts.FuncOpts(handler),
		}),
	)

@Koooooo-7 Koooooo-7 added question Further information is requested and removed enhancement New feature or request labels Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants