[Angular 2]
<ej-chart (legendItemClick)='legendItemClick($event)'>
</ej-chart>
legendItemClick(sender) {
alert("SeriesIndex : "+sender.data.legendItem.Style.SeriesIndex);
} |
Hi
Thanks for the hint.
I checked this one already out and it works as expected. But If i need the state (visible or hidden) of the series I get the wrong in the moment the event is triggered. So I needed to set a timeout of some milliseconds around the part where I look for the visibility.
Is there a smarter way for getting the correct visibility?
Regards
Bernd
[Angular 2]
<ej-chart (legendItemClick)='legendItemClick($event)'>
</ej-chart>
legendItemClick(sender) {
var value, str="";
for (var i = 0; i < sender.model.series.length; i++) {
if (i == sender.data.legendItem.Style.SeriesIndex)
value = sender.model.series[i].visibility == "hidden" ? "visible" : "hidden";
else
value = sender.model.series[i].visibility;
str += "\nSeries " + i + " : " + value;
}
alert(str);
}
|
Hi Dharani
This did the trick. Thanks for helping.
Bernd