Legend hover

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
Jim Green
Newbie
Newbie
Posts: 43
Joined: Thu Aug 03, 2006 12:00 am

Legend hover

Post by Jim Green » Mon Jul 21, 2014 6:08 pm

Hi, have my developer copy now, so I can see what's happening in source. Good stuff!

First, the hover color is hard-coded to red in drawItem():

Code: Select all

    if (this.over==index)
      f.font.fill="red";
Red is a questionable choice - it's easy to associate red with errors. If anything, the series stroke color might be more appropriate (which defaults to red but can be changed).

Second, is there a purpose to having a hover color at all? It looks like you can define a Legend.onclick function, but if there is no onclick then hover decoration is inappropriate. (BTW, there is no mention of onclick in the docs, or what mousedown does.)

For now, I've suppressed the hover color with:

Code: Select all

legend.mousemove = function() {};
but it would be more elegant to either not show decoration when there is no onclick, or allow it to be turned off (e.g., hoverEnabled = false).

Thanks,
Jim

Marc
Site Admin
Site Admin
Posts: 1209
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Legend hover

Post by Marc » Mon Jul 28, 2014 9:48 am

Hello Jim,

Yes you're right. Fixing that to red is too limiting. We'll modify flexibility/parameterisation for it.

Regards,
Marc
Steema Support

Marc
Site Admin
Site Admin
Posts: 1209
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Legend hover

Post by Marc » Mon Jul 28, 2014 3:21 pm

Funcionality added for inclusion in next update.

http://bugs.teechart.net/show_bug.cgi?id=869

Jim Green
Newbie
Newbie
Posts: 43
Joined: Thu Aug 03, 2006 12:00 am

Re: Legend hover

Post by Jim Green » Mon Jul 28, 2014 6:09 pm

Thanks!

Post Reply