-
-
Notifications
You must be signed in to change notification settings - Fork 78
Added OnClick for charts #961
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
base: main
Are you sure you want to change the base?
Conversation
I updated it to use the new ChartClickArgs. Now you can get the label name and index. So now it looks more like this: <PieChart @ref="pieChart" Width="500" OnClick="Clicked" />
@code{
// Other stuff
private void Clicked(ChartClickArgs args){
Console.WriteLine($"Clicked on: {args.LabelName} with index {args.Index}");
}
} |
@yannikHoeflich Thank you for your time and the pull request. I'll take care of it. |
tried your fork and got this error when trying the bar chart Uncaught TypeError: can't access property "invokeMethodAsync", dotNetHelper is undefined
|
Sorry for the late response. I will take a look at it. |
Sorry, I forgot to do some changes at the other charts. That should fix it |
This PR adds an OnClick attribute for all charts here is an example for a pie chart:
The parameter for the event is the label name, sadly there is not really a better option.