GrantMStevens / amCharts-Angular

Angular directive for amCharts library
Apache License 2.0
63 stars 39 forks source link

How to detecting at what value mouse pointer is? #38

Closed SzymonPawlak closed 8 years ago

SzymonPawlak commented 8 years ago

I would like implement this funconality https://www.amcharts.com/tutorials/detecting-at-what-value-mouse-pointer-is/. How to do this?

I tred to do this on this way :

categoryAxis: {
                minPeriod:'mm',
                parseDates :true,
                listeners: [{
                event: "move",
                    method: function(value) {
                        console.log(value.value);
                    }
                }]

but it doesn't work

I would be very grateful for your help

GrantMStevens commented 8 years ago

The listeners property is probably getting filtered out. I basically exclude any top level properties from getting added if they are arrays or objects (so I can specifically manager things like valueAxis, categoryAxis, etc.). I'll have to look in to adding this at some point.

developer1 commented 8 years ago

Just created pull request #39 which addresses this :)

GrantMStevens commented 8 years ago

Merged your pr

developer1 commented 8 years ago

Sorry I overlooked that Sacred90 was trying to attach listeners to a chart component - #40 fixes that

narendra-agashe commented 8 years ago

I am trying to do similar thing with the legend, but i don't see legend events getting fired. "legend": { "divId": "legend", "listeners": [{ event: "hideItem", method: function(item) { console.info(item); //toggleAllGraphs(item, 'hide'); } }, { event: "showItem", method: function(item) { console.info(item); //toggleAllGraphs(item, 'show'); } }] } I am feeding the chart options object through scope to the directive. Any help would be highly appreciated.

Thanks, Narendra