-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
HTML Table within Tooltip callback #3734
Comments
@azcanada do you have an image of what you are trying to achieve? The current tooltip is drawn on the canvas so it won't support HTML. Have you looked at the https://github.com/chartjs/Chart.js/blob/master/samples/tooltips/line-customTooltips.html sample? The other option is to use the work merged in #3718 (not yet released) and write a plugin that handles the mouse events to conditionally display the table. |
I have looked at the custom tooltip sample but I am struggling to reference
specific parts of my chart. My chart has 2 stacked bar charts with 2 line
charts overlayed so there's a lot going on.
My issue is similar to #3728 and I think returning as an array will work
for me. I'll check it out tomorrow and let you know the progress. Let's
leave this open for now?
I think a plugin to support an easier method of editing within the tooltip
would be great. Look forward to the changes in 2.5.
Thanks for the reply Everet.
|
Sure we can leave this open. I'll do some thinking about better ways to handle this. You might even be able to use the |
Closing as out of date |
Hi there,
I am trying to create a HTML table within a label callback function.
Within the function we are querying a database based upon the point on the data selected. The query works perfectly as I can document.write(queryanswer) to create my table in a new table.
However when I try to add the table within the tooltip I only get the text and not the formatted html. I think this is because the tooltip is a SVG. I attempted using a foreign object but still no luck.
The only other idea I came across was to use the customtooltip which will allow me to use html but I can not find a way to find the define the variables from the graph for the query.
Is there support for this?
Many thanks in advance
The text was updated successfully, but these errors were encountered: