sainanky
sainanky

Reputation: 507

Not able to get parameter value on click of gantt bar chart of amcharts

This is my gantt bar chart. Actually what I need to get is the value which I am passing like taskname or any other extra value. When I click on any bar the click event is working fine but I am not getting the value of series like task name on click of that bar. My data format:

    {
      "start": "2016-01-01",
      "end": "2016-01-14",
      "color": "#b9783f",
      "task": "Gathering requirements"  //that name i need to find when i click on any bar
    }

and my click function is working like :

     "listeners": [{
        "event": "clickGraphItem",
        "method": function (event) {
            debugger;
            alert(event.item.category);
        }
    }]

If someone has any idea about amcharts can you please help me out. The fiddle link is : http://jsfiddle.net/cuo9d2pz/ Image

Upvotes: 1

Views: 246

Answers (2)

sainanky
sainanky

Reputation: 507

I managed to do this using:

event.item.graph.customData.task

Upvotes: 1

V Soren
V Soren

Reputation: 316

You can access it via event.graph.segmentData.task

Upvotes: 1

Related Questions