Legend hover
Posted: 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():
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:
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
First, the hover color is hard-coded to red in drawItem():
Code: Select all
if (this.over==index)
f.font.fill="red";
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() {};
Thanks,
Jim