1

I have a graph made in gRaphael.js with 3 different plots each with their own tags

I use hoverColumn method to display the data for each of the tags on the 3 plots. I want to display extra information when I click on one of the tags.

I want to know if I can add an id to each of the tags, or if there is any method to add event listeners to the tags so I can identify the event more easily and know what I have to display.

If I use the click method the graph goes crazy all my tags get enlarged and black and everything stops working

This is a small piece of my code. I removed some parts that that I did not think were important.

var lines = r.linechart(50, 10, 800, 700, xaxis, yaxisarray, options).hoverColumn(function () {
    this.tags = r.set();

    for (var i = 0, ii = this.y.length; i < ii; i++) {
                    // create the tag
        this.tags.push(r.tag(this.x, this.y[i], this.values[i] + ' ms', 0, 8).insertBefore(this));
    }
}, function () {
    this.tags && this.tags.remove();
})

To reiterate: How can I tell which marker/tag I clicked (individually)

andrei
  • 8,252
  • 14
  • 51
  • 66

0 Answers0