【问题标题】:Highcharts Bubble Chart - How to get the size of the pointHighcharts 气泡图 - 如何获取点的大小
【发布时间】:2013-03-18 09:10:55
【问题描述】:

我想格式化气泡图的工具提示,但我需要知道是什么属性让我知道气泡的大小。

【问题讨论】:

    标签: size highcharts bubble-chart


    【解决方案1】:

    如果你使用的是格式化函数,你会做这样的事情:

    tooltip :
      formatter: function() {
          return "My bubble size is : " + this.point.z;
      }
    }
    

    this.point 在气泡图工具提示格式化程序中还具有以下属性:series、x 和 y

    更多信息请见:http://api.highcharts.com/highcharts#tooltip.formatter

    【讨论】:

    • 成功了!谢谢。 API 从未提及“z”作为属性。我想可能是z。让我感到震惊的另一件事是“这个”是对这一点的引用。我不认为我需要 this.point 似乎我们正在引用 point.point。
    【解决方案2】:

    您可以通过在formatter 函数中访问this.point.shapeArgs.r 来获取半径。就像@scott-gearhart 的解决方案一样

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-26
      • 2011-12-23
      • 2019-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-13
      相关资源
      最近更新 更多