【问题标题】:Can I change the hover cursor of a datapoint in a AnyChart Column chart?我可以更改 AnyChart 柱形图中数据点的悬停光标吗?
【发布时间】:2023-02-09 22:12:50
【问题描述】:

我有一个 AnyChart 柱形图,单击其中的数据项将重定向到我的解决方案中的另一个页面。 是否可以为这些数据项设置悬停光标?

【问题讨论】:

    标签: anychart


    【解决方案1】:

    要为单个列创建 hoverCursor() 效果,您可以使用 listen() 方法为“pointMousOver”事件创建侦听器,并为“pointMousOut”再次执行此操作。

    // create an event listener for the pointMouseOut event
    chart.listen("pointMouseOver", function(e){
        // change the cursor style
        document.body.style.cursor = "pointer";
    });
      
    // create an event listener for the pointMouseOut event
    chart.listen("pointMouseOut", function(e){
        // set the default cursor style
        document.body.style.cursor = "auto";
    });
    

    此示例中显示:https://playground.anychart.com/mVLAJ3Pm/2

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-20
      • 1970-01-01
      • 1970-01-01
      • 2013-09-23
      • 2012-09-22
      • 1970-01-01
      • 2016-07-11
      相关资源
      最近更新 更多