Page 1 of 1

Legend hover

Posted: Mon Jul 21, 2014 6:08 pm
by 9347097
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

Re: Legend hover

Posted: Mon Jul 28, 2014 9:48 am
by Marc
Hello Jim,

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

Regards,
Marc

Re: Legend hover

Posted: Mon Jul 28, 2014 3:21 pm
by Marc
Funcionality added for inclusion in next update.

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

Re: Legend hover

Posted: Mon Jul 28, 2014 6:09 pm
by 9347097
Thanks!