This is a follow-up to #1321942: Tool tips are not displayed
As I continue to hack into the Highcharts module, I've gotten a much better understanding of a lot of the code, but one of the bugs that continues to elude me is the inability to set the tooltip formatter. I've been changing a lot of the code, but even before I altered anything around the tooltip formatter, my Firebug console was picking up an error in the Highcharts source JS code: "D.call is not a function" every time I hovered over the data points on my graphs.
I looked in there, blindly changed D.call on line 41 of "sites/all/libraries/highcharts/js/highcharts.js " to d.call, and now see the tooltip hovering over each bar when I mouseover. Unfortunately, the only thing that displays is [object Object], and not the value of each data point.
Hours of Google-searching and trying to hard-code in values has gotten me nowhere, and I've not been able to change the text in the tooltip whatsoever. It may perhaps be related to this thread but I'm not sure.
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | highcharts-tooltip-formatter-1466016-27.patch | 651 bytes | sylvain lavielle |
| #23 | highcharts-tooltip-formatter-1466016-23.patch | 637 bytes | larskleiner |
| #22 | highcharts-tooltip-formatter-1466016-22.patch | 631 bytes | larskleiner |
| #4 | survey_graph.png | 120.41 KB | somimi |
| #1 | tooltip.png | 28.55 KB | somimi |
Comments
Comment #1
somimi commentedHere is a screenshot of what I'm referring to:
Comment #2
stovak commentedhaven't gotten to tooltips yet. I will make sure they're functional before version 1.0.
Comment #3
somimi commentedThanks for the reply, and thanks for your work on this module. Yeah, I think it may have something to do with drupal_add_js putting quotes around everything and turning the formatter function into a string.
Comment #4
somimi commentedOh, nevermind, I got the tooltip formatter to work! I commented out this code in views_highcharts.theme.inc:
and changed "d.call" back to "D.call" in the highcharts.js file.
Comment #5
pvhee commented#4 works for me as well.
This module is nice work, but needs quite some work & cleanup to get all of it working. I'll look into submitting a series of patches.
Comment #6
scottrigbyThis is resolved a little differently (for full highcharts API flexibility) in #1507800: Views-independent Highcharts API.
@stovak, if you agree on the approach there, we could mark this as duplicate and handle the tasks on that issue.
Comment #7
scottrigby^ Specifically we solved this by explicitly adding the highchart options object methods separately, which couldn't be passed through Drupal.settings. Check out the bottom of highcharts_render() in http://drupal.org/sandbox/scottrigby/1507774. The tooltip is the only example added atm, as a proof-of-concept - and it works well without modifying anything else.
Comment #8
Zet123 commentedI am using 7.x-1.0-alpha6, but I cannot seem to get the tooltip working. I get the following error: D.call is not a function. I did try out the solutions outlined above. Help please!!!
Comment #9
rolkos commentedI also have some problems with OG + UUID. After I installed uuid (because of highcharts), some OG views handlers just disappeared, I noticed that, OG relationship are broken and for example I can't use (group) OG group: OG membership.
Another thing is uuid_tokens it's also broken.
So for now at least for me uuid should be avoided if it’s possible.
Regardless UUID troubles, hightcharts is great module and I'm really grateful for it.
Thanks!
Comment #10
Scryver commentedDoes it still work when you change the function, so it is not the default? Because to me it seems that the whole $formatter piece of code doesn't do anything.
Comment #11
scottrigbyAnyone interested may want to help test the 7.x-2.x branch, where this issue has been resolved. The new API there has been tested including tooltip), but the Views integration in that branch has not been thoroughly tested yet.
Comment #12
scottrigbyI think @stovak's comment in #1561694-5: Highcharts views theme functions and templates was meant for this issue:
In any case that will happen in the 2.x branch.
Comment #13
scottrigbyClarifying title to prevent further duplicates (like #1528822: Tool Tip Formatter and #1564910: Tooltip formatter doesn't seem to be implemented).
Comment #14
Scryver commentedAgain a really cool module. We actively use it and I just updated the site to the new 2.x branch. (check out ClimbCheck ). But now I would like to edit (not append) the tooltip. Is this possible through a hack, temporary?
Comment #15
stovak commentedSo with my new config module, my idea is to add the formatting function by adding a Drupal.behavior with one function then reference the behavior in the new config class. Long story short, yes, the hack is temporary.
-tom
Comment #16
jeremymcminn commented#4 did work previously, but now when I comment it out it causes my browser to crash as soon as I hover over the chart. I'm not even sure how to troublehsoot that.
Comment #17
dshields commentedI found this browser crash issue in Chrome, but found the solution to be adding
$highcharts_config->tooltip->useHTML = true;
...to views_highcharts.theme.inc, right above the lines that are commented out.
Something like this:
Hope that helps.
I still can't figure out how to actually edit the tooltip format, though.
Comment #18
jeremymcminn commentedThanks for that, was wondering why it was crashing - Intersting that no solution has been found for editing the format of the tooltips though
Comment #19
scottrigby@dshields What version of highcharts module are you using? the 7.x-2.x branch does not have the
eval()code in it:http://drupalcode.org/project/highcharts.git/blob/refs/heads/7.x-2.x:/hi...
Please test this branch and let us know if you still run into issues, or need any help implementing the tooltip.
@jeremymcminn you can edit the tooltip.
See #7 above, which became the 7.x-2.x branch in #1507800: Views-independent Highcharts API
There are some more niceties we've been working on that still need to be pushed, and will probably do that soon.
We should also #1542336: Add version information to the project page to avoid confusion about branches…
Comment #20
jeremymcminn commentedHi Scott
Thanks for that, will test these out and let you know
Jeremy
Comment #21
dshields commentedThanks for the help. While I think the project I was working on has wrapped up, I'd really like to be able to draw on this module in the future so I'll continue to test.
So far, I"m running into the same issue as #1547090: Autoload files
Comment #22
larskleiner commentedHow about removing any tooltip code from 7.x-1.x until it's ready?
We've evaluated 7.x-2.x but want to stick with 7.x-1.x for the time being. I'm re-tagging this issue as 7.x-1.x because it hasn't been fixed for this branch.
Tooltips support is not essential for us but we need to get rid of the following error.
Commenting out the tooltips-related code in views_highcharts.theme.inc as suggested in #4 fixes this, see attached patch.
Comment #23
larskleiner commentedRe-rolled patch to work with git checkout of 7.x-1.x-dev (different then the 7.x-1.x download version, see http://drupal.org/node/1773498).
Comment #24
scottrigbyI have just committed a fix to the 7.x-2.x branch for tooltips:
d516a73
@larskleiner Thanks for the patch for the improperly named 7.x-1.x-dev branch, which needs to be cleaned up (one way or another). But let's follow up on that in the other issue. This issue will focus on fixing the 2.x branch for now.
Comment #25
scottrigbyComment #27
sylvain lavielle commentedThis bug stills here on the current 7.x-1.0-alpha6 version but none of the previously submitted patches seem to apply correctly on it, so here's the patch for 7.x-1.0-alpha6