Page 1 of 1

Changing Font Style Of Tooltip In Graphs

Posted: Tue 08 Dec 2015 10:21 am
by Grimers
Hello,

Is it possible to change the style of the font for the graph values when displayed on hovering over the graph from bold to normal e.g. 13.6°C?

Many thanks,

William

Re: Changing Font Style Of Tooltip In Graphs

Posted: Tue 08 Dec 2015 10:54 am
by mcrossley
I wondered why you deleted the thread I just replied to!

Yes, you need to change the tooltip definitions in cumuluscharts.js, the documentation is here: http://api.highcharts.com/highcharts#tooltip
You will probably need to use a formatter function.

Be aware though that MX undergoes regular releases, and these files may be subject to change by Steve, so you might have to redo your work.

Re: Changing Font Style Of Tooltip In Graphs

Posted: Tue 08 Dec 2015 3:35 pm
by Grimers
Thanks, Mark. I'm not too worried about making changes because I simply copy my old files I've changed over in to the new version. :)

Ok, I've just looked through that but nowhere does it mention formatting text...

Re: Changing Font Style Of Tooltip In Graphs

Posted: Tue 08 Dec 2015 3:58 pm
by mcrossley
Did you look at formatter: Function and the examples that it links to? That is all about formatting the data and text.

Re: Changing Font Style Of Tooltip In Graphs

Posted: Tue 08 Dec 2015 4:05 pm
by Grimers
mcrossley wrote:Did you look at formatter: Function and the examples that it links to? That is all about formatting the data and text.
EDIT: Fixed it now, thanks very much for the help, Mark. Very appreciated. :)

Re: Changing Font Style Of Tooltip In Graphs

Posted: Tue 08 Dec 2015 4:08 pm
by mcrossley
No it doesn't, Steve is using the default format, but you want to change that default formatting which HighCharts provides, so you will have to write a formatter function to do that.

Re: Changing Font Style Of Tooltip In Graphs

Posted: Tue 08 Dec 2015 4:16 pm
by steve
Isn't the tooltip pointFormat string an easier way to do this? The default is

<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y}</b><br/>

You just need the same string without the <b> and the </b>

Re: Changing Font Style Of Tooltip In Graphs

Posted: Tue 08 Dec 2015 4:24 pm
by Grimers
steve wrote:Isn't the tooltip pointFormat string an easier way to do this? The default is

<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y}</b><br/>

You just need the same string without the <b> and the </b>
You're correct, I was just about to try that actually, when I finally found out that was the way, thanks guys for your help.

Re: Changing Font Style Of Tooltip In Graphs

Posted: Tue 08 Dec 2015 4:59 pm
by mcrossley
steve wrote:Isn't the tooltip pointFormat string an easier way to do this?
Doh! Yes it is :bash:

Re: Changing Font Style Of Tooltip In Graphs

Posted: Thu 10 Dec 2015 6:23 am
by duke
Grimers wrote:Thanks, Mark. I'm not too worried about making changes because I simply copy my old files I've changed over in to the new version. :)
You can't simply copy your old 'modified' files to a newer version of MX, you will need to go through the file to make yourself aware of updates Steve may have made elsewhere in the file. If you simply copy over your files you may well be making parts of your new installation old.

Helpfully Steve has started posting which files have he has updated and using a program like Beyond Compare will speed up the search for any changes.

Re: Changing Font Style Of Tooltip In Graphs

Posted: Thu 10 Dec 2015 11:47 am
by Grimers
duke wrote:
Grimers wrote:Thanks, Mark. I'm not too worried about making changes because I simply copy my old files I've changed over in to the new version. :)
You can't simply copy your old 'modified' files to a newer version of MX, you will need to go through the file to make yourself aware of updates Steve may have made elsewhere in the file. If you simply copy over your files you may well be making parts of your new installation old.

Helpfully Steve has started posting which files have he has updated and using a program like Beyond Compare will speed up the search for any changes.
No, I understand that. But, all I'm saying is is that I want my pages to stay the same to what I have modified to and as long as they are processed by the new build then what's wrong with that?

Re: Changing Font Style Of Tooltip In Graphs

Posted: Thu 10 Dec 2015 12:40 pm
by steve
You should be OK doing that, it's quite likely that your modified pages and javascript will work fine with new releases of MX. As Duke suggests, you need to watch for any files changing in the release which might affect your modifications - it should be fairly obvious if they do.

Re: Changing Font Style Of Tooltip In Graphs

Posted: Thu 10 Dec 2015 9:03 pm
by Grimers
steve wrote:You should be OK doing that, it's quite likely that your modified pages and javascript will work fine with new releases of MX. As Duke suggests, you need to watch for any files changing in the release which might affect your modifications - it should be fairly obvious if they do.
Thanks, Steve. I've downloaded the file that Mark has given me which I'm very appreciative of. It's a nice piece of software and I've checked both files and they look ok with just my slight modifications.