highcharts 将漏斗高图设置为等高

xuo3flqw  于 2022-11-10  发布在  Highcharts
关注(0)|答案(1)|浏览(195)

我是HighCharts的新手。我已经用下面的脚本创建了一个漏斗

  1. Highcharts.chart('container', {
  2. chart: {
  3. type: 'funnel'
  4. },
  5. title: {
  6. text: 'Sales funnel'
  7. },
  8. plotOptions: {
  9. series: {
  10. dataLabels: {
  11. enabled: true,
  12. format: '<b>{point.name}</b> ({point.y:,.0f})',
  13. softConnector: true,
  14. inside: true,
  15. },
  16. neckHeight: "0%",
  17. neckWidth: "80%",
  18. width: '15%',
  19. reversed: true,
  20. }
  21. },
  22. legend: {
  23. enabled: false
  24. },
  25. series: [{
  26. name: 'Unique users',
  27. data: [
  28. ['Website visits', 15654],
  29. ['Downloads', 4064],
  30. ['Requested price list', 1987],
  31. ['Invoice sent', 976],
  32. ['Finalized', 846]
  33. ]
  34. }]
  35. });

jsfiddle:https://jsfiddle.net/kiranuk/bavLxzrp/的参数值
如何为所有部分设置相同的高度?
谢谢你的帮助。

mwyxok5s

mwyxok5s1#

区段 的 高度 是 根据 数据 来 计算 的 。 如果 您 想要 有 相等 的 区段 , 您 可以 提供 模拟 的 相等 数据 , 并 在 工具 提示 和 数据 标签 中 显示 实际 数据 。 例如 :

  1. plotOptions: {
  2. series: {
  3. dataLabels: {
  4. format: '<b>{point.name}</b> ({point.realY:,.0f})',
  5. ...
  6. },
  7. ...
  8. }
  9. },
  10. tooltip: {
  11. formatter: function() {
  12. return this.series.name + '<br><span style="color:' + this.color + '">●</span> ' + this.point.name + ': <b>' + this.point.realY + '</b>';
  13. }
  14. },
  15. series: [{
  16. name: 'Unique users',
  17. keys: ['name', 'y', 'realY'],
  18. data: [
  19. ['Website visits', 1, 15654],
  20. ['Downloads', 1, 4064],
  21. ['Requested price list', 1, 1987],
  22. ['Invoice sent', 1, 976],
  23. ['Finalized', 1, 846]
  24. ]
  25. }]

中 的 每 一 个

展开查看全部

相关问题