-
Notifications
You must be signed in to change notification settings - Fork 158
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
Custom Ticks Format callback #62
Comments
Thank you for contacting us! This is a big feature which we should definitely support at some point but we need to be careful on how we implement it otherwise it might be hard to use. Note that in order to implement this, we need a robust system for "delegate-communication" between js and c# (a c# delegate has be callable by js and the return value of the c# delegate has to be sent back to the js-caller). By being careful on how we implement it I meant that we really need to make this system strongly typed and not with a Maybe I have time in the coming days and I'll look over it and try to come up with a good foundation but I can't promise anything. Once we have the foundation the custom tick formats are only one of the many callbacks we want to support (e.g. look at all the tooltip-callbacks). |
@Joelius300 , thank you for your code. Isn't There any solution to be able to use chartjs callbacks with blazor server side? tia! |
Unfortunately you've noticed correctly, on server-side callbacks that have a return value can only be implemented with javascript at the moment. You can use If you're interested, I've already asked SO without much success. The next step is probably asking the blazor team if they'll ever implement synchronous C# interop but to be honest I don't think they will (and maybe they simply can't because of all the underlying stuff). Also about your comment
As far as I can tell this wouldn't help us. Either you'd inject javascript, meaning you'd have to write js-code (which you can already do much easier) or you'd have to call back into C# which will bring us back to the original issue with once async, always async. Or do you have a different idea? |
hi @Joelius300 Do you think this could help? https://github.com/luciotato/waitfor-ES6 I don't know much javascript either. |
As far as I can tell that won't work because you'd have to create a generator which means that instead of having I'm not good with js so if anyone has an idea or knows how to solve this, please tell us :) |
As far as I understand, this has been implemented in 58870b6 and the only point of discussion was the incompatiblity with Server-Side Blazor. It's also used in the sine line sample. Closing this issue. If I missed something, feel free to comment. |
Many times It is necessary to customize ticks in axis and this is normally do it using callback.
https://www.chartjs.org/docs/latest/axes/labelling.html#creating-custom-tick-formats
The text was updated successfully, but these errors were encountered: