admin管理员组文章数量:1316541
So I have a ColumnChart and one of the built-in functionality is that you can hover over an item (so called category) in the legend of the chart and you get some highlight-border around the corresponding columns in the chart.
Now I have many columns and categories in my chart and a highlighted series/category is very hard to see, because the default behavior just shows a 1px gray border around the columns. My columns are only a few pixels width and I still need to differentiate 10 different categories (=colors). So picking only very light colors (where the border would be easy to spot) is no option. I've found no way of changing:
- The style of the highlight-border (primarily the color) or
- The color of the columns (fill color) when their respective category is selected in the legend.
Is there some property I can pass to the draw()
call of my chart to change the highlighting? Do I have to manually override some events/methods?
Help is highly appreciated!
So I have a ColumnChart and one of the built-in functionality is that you can hover over an item (so called category) in the legend of the chart and you get some highlight-border around the corresponding columns in the chart.
Now I have many columns and categories in my chart and a highlighted series/category is very hard to see, because the default behavior just shows a 1px gray border around the columns. My columns are only a few pixels width and I still need to differentiate 10 different categories (=colors). So picking only very light colors (where the border would be easy to spot) is no option. I've found no way of changing:
- The style of the highlight-border (primarily the color) or
- The color of the columns (fill color) when their respective category is selected in the legend.
Is there some property I can pass to the draw()
call of my chart to change the highlighting? Do I have to manually override some events/methods?
Help is highly appreciated!
Share Improve this question edited Oct 29, 2012 at 19:11 Peter Ilfrich asked Oct 28, 2012 at 17:35 Peter IlfrichPeter Ilfrich 3,8163 gold badges33 silver badges35 bronze badges1 Answer
Reset to default 9In the past I used some CSS hacks to change some properties of the generated SVG (path, rect, etc...) you can play around with advanced selectors and maybe you'll be able to achieve you what you want. I created a very quick and buggy example, but maybe it will point you on the right direction.
For example:
div.google_chart svg g g g g rect {
stroke-width:0px; fill:red;
}
Hope it helps.
本文标签: javascriptGoogle Chart API Change color on hovering legendStack Overflow
版权声明:本文标题:javascript - Google Chart API: Change color on hovering legend - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742006823a2412126.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论