user1549992
user1549992

Reputation: 21

Highstock - How to change tooltip color

I'm using a highstock chart similar to this example - http://jsfiddle.net/93HQn/2/. What I"m trying to add is for the % value in the tooltip to be red if it is a negative value or green if it is positive value. Has anyone done this before?

Thanks, Linda

Upvotes: 1

Views: 8042

Answers (2)

JohnnyHK
JohnnyHK

Reputation: 311835

Define a formatter function for your tooltips:

http://api.highcharts.com/highcharts#tooltip.formatter

With that you should be able to take full control of the tooltip contents.

Upvotes: 2

Linger
Linger

Reputation: 15048

You can change the color of any potion of the tooltip based on a value or calculation. I modified your jsfiddle to show how to change the color of the percentage based on if it is positive or negative.

Upvotes: 4

Related Questions