casillas
casillas

Reputation: 16813

MouseOver with Cursor Pointer on Y Axis

The following implementation shows mouseover event with cursor pointer on y axis title label. It works and functional.

However, I want to implement mouseover event with cursor pointer on y axis (numeric axis) as well.

CURRENT IMPLEMENTATION

Upvotes: 0

Views: 455

Answers (3)

Alex Bubblemaster
Alex Bubblemaster

Reputation: 106

there is actually a supported option with a custom visual:

categoryAxis: [{
labels: {
  color: "rgba(60,60,60, 0.9995)",
  visual: function(e) {
    var visual = e.createVisual();
    visual.options.cursor = 'pointer';
    return visual;
  }
}

}]

drawing.element.configuration.cursor

Runnable Dojo

Upvotes: 0

ezanker
ezanker

Reputation: 24738

You can apply the same color trick to the axis labels:

valueAxis: {
    labels: {
        format: "N0",
        color: "rgba(60,60,60, 0.9995)"
    },

$(document).on("mouseover", '#chart text[fill="rgba(60,60,60, 0.9995)"]', function(){
    $('#chart text[fill="rgba(60,60,60, 0.9995)"]').css("cursor", "pointer");
});

Updated DEMO

In this example I use the same color for title and labels, you could easily use a different color

Upvotes: 2

Keval Bhatt
Keval Bhatt

Reputation: 6322

If you can add some id or class then it is good but in your code I cant find class so I used stroke

 $(document).on("mouseover", '#chart text[stroke="none"]', function(){
               $('#chart text[stroke="none"]').css("cursor", "pointer");
             });

Upvotes: 1

Related Questions