anychart

Can I change the hover cursor of a datapoint in a AnyChart Column chart?


I have a AnyChart column chart in which the dataitems when clicked on will redirect to another page in my solution. Is it possible to set the hover cursor for these dataitems?


Solution

  • To create a hoverCursor() effect for individual columns, you could use listen() method to create a listener for a “pointMousOver” event and do it again for a “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";
    });
    

    Shown in this sample: https://playground.anychart.com/mVLAJ3Pm/2