最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Hiding bubble label on google bubble charts - Stack Overflow

programmeradmin2浏览0评论

I'm working with Google Charts API to display a bubble chart. Everything is working fine except that the labels on the individual bubbles gets kind of annoying when the bubbles are close together. I really just want to hide the labels but can't seem to find an option to do it. Has anyone worked with google bubble charts and knows how to hide the label?

I'm working with Google Charts API to display a bubble chart. Everything is working fine except that the labels on the individual bubbles gets kind of annoying when the bubbles are close together. I really just want to hide the labels but can't seem to find an option to do it. Has anyone worked with google bubble charts and knows how to hide the label?

Share Improve this question asked Jan 30, 2012 at 4:00 sankofamusiciansankofamusician 1111 silver badge3 bronze badges 3
  • 2 I found the answer to this. There is an option for the bubble text in options. bubble: {textStyle: {color: 'none'}} – sankofamusician Commented Jan 31, 2012 at 13:20
  • Or set the 'trigger' to 'none': var options = { tooltip: { trigger: 'none' }, – user1998461 Commented Jan 21, 2013 at 22:02
  • bubble: {textStyle: {color: 'none'}} works, thanks. Still, the example by google charts (developers.google./chart/interactive/docs/gallery/…) hide only the labels that do not fit. This is even nicer. However, the chart options of the example do not have anything specific, and if I copy the code it shows all labels, not just the ones that fit... – Wouter Commented Dec 17, 2017 at 12:31
Add a ment  | 

2 Answers 2

Reset to default 7

If you set the first column of the data table to a blank string then you won't have this information in the tooltips either.

An alternative is to keep the strings and set bubble.textStyle.color = "transparent"

Set the values in the first column (ID) to a blank string. See the documentation, second example https://developers.google./chart/interactive/docs/gallery/bubblechart

发布评论

评论列表(0)

  1. 暂无评论