Created
October 4, 2012 20:22
-
-
Save aboutaaron/3836183 to your computer and use it in GitHub Desktop.
Shitty load in IE6-9?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tooltip: { | |
useHTML: true, | |
formatter: function() { | |
// This is using the Highcharts tooltip API plus the JS ternary operator to conditionally add tooltips to the accumulated gross | |
// http://stackoverflow.com/a/7344366/868724 | |
return this.x + "<br>" + this.series.name + ': <strong>$' + Highcharts.numberFormat(this.y) + '</strong>' + ( typeof this.point.weeks !== "undefined" ? "<br>Weeks in box office: " + this.point.weeks : "" ) | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the ternary operator, If this.point.weeks does not evaluate as undefined, return this string, else, return an empty one. Now, why wouldn't IE like this?