简体   繁体   English

如何更改amChart中的气球位置

[英]How to change ballon location in amChart

I'm actually building an amchart but I can't find a way to modify the position of the balloons that appear on my bullets. 我实际上正在建立一个amchart,但我找不到一种方法来修改我的子弹上出现的气球的位置。

Here is my code : 这是我的代码:

var chart = AmCharts.makeChart("chartdiv", {
      ...
      "balloon": {
        "textAlign" : "left",
        "color" : "#000000",
        "fixedPosition" : false,
        "offsetX" : 50,
        "offsetY" : 50,
        "animationDuration" : 0.3,
        "borderAlpha" : 0,
        "borderColor" : "#FFFFFF",
        "cornerRadius" : 0,
        "pointerWidth" : 0,
        "showBullet" : false,
        "horizontalPadding" : 5,
        "verticalPadding" : 5,
      }
    });

But here is what I get : 但这是我得到的: 在此输入图像描述 Why the offsetX and offsetY don't have any effect on my ballon? 为什么offsetX和offsetY对我的气球没有任何影响?

Per the documentation , offsetX and offsetY only work when fixedPosition is set to false and the chart cursor is disabled. 根据文档offsetXoffsetY仅在fixedPosition设置为false且禁用图表光标时才起作用。 Since you have the cursor enabled, it won't work. 由于您启用了光标,因此无法使用。 You'll need to use an external div if you want to change the position while using a cursor, similar to this demo . 如果要在使用光标时更改位置,则需要使用外部div,类似于此演示 Note that the changed listener will go into the stock panel for the stock chart. 请注意, changed侦听器将进入股票图表的库存面板

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM