Reputation: 1096
I am using Highchrt and i want click on lengend on load.
I am using angular ionic so how can i click .highcharts-legend-item
class in ngOnInit() {}
function.
I want click tthis class on page is load with angular ionic.
In javascript $(.highcharts-legend-item).click();
but i dont knw in anular ionic.
Upvotes: 1
Views: 515
Reputation: 556
If you're using Ionic, you're still in a browser, so you can use the standard html-js API.
document.querySelector('.highcharts-legend-item').click()
Use ElementRef and click the element programmatically
ts:
constructor(private elem: ElementRef){}
ngAfterViewInit(){
this.elem.nativeElement.querySelector('.highcharts-legend-item').click();
}
Upvotes: 2