【问题标题】:amcharts - ClockHand - How to add a ToolTipamcharts - ClockHand - 如何添加工具提示
【发布时间】:2020-08-06 21:32:17
【问题描述】:

我按照这个例子用 AmCharts 构建一个仪表图:https://www.amcharts.com/demos/gauge-with-bands/

经过一些修改,我添加了一个新的 ClockHand 元素,如下图所示: In the gauge graph, I adde a second ClockHand (blue color) and try to add a ToolTip..

但是当我尝试使用这个工具提示时,它没有显示在正确的位置。我正在使用此代码:

var hand2 = chartdivGauge.hands.push(new am4charts.ClockHand());
hand2.innerRadius = am4core.percent(95);
hand2.radius = am4core.percent(100);
hand2.startWidth = 20;
hand2.pin.disabled = true;
hand2.value = 50; 
hand2.fill = am4core.color('blue');
hand2.stroke = am4core.color('blue');
hand2.tooltipText = "AAA";

那么,我该如何解决呢?我怎样才能把这个工具提示放在正确的位置,靠近时钟。

谢谢!

【问题讨论】:

    标签: javascript amcharts amcharts4


    【解决方案1】:

    感谢@martynasma,我在 GitHub amcharts 论坛上得到了答案,看看:

    https://github.com/amcharts/amcharts4/issues/2778

    ClockHand 是一个大元素,由许多子元素组成。

    我建议你把 tooltip 放在它的手子元素上:

    hand2.hand.tooltipText = "我的工具提示";

    【讨论】:

      猜你喜欢
      • 2020-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多