I am trying to implement EChart Baidu in Angular 2 application (typescript).
I am following the start guide on their website https://ecomfe.github.io/echarts/doc/start-en.html but have no idea how I am supposed to init the chart having no clue about the function parameter of this line of code:
function (ec) {
var myChart = ec.init(document.getElementById('main'));
Using Angular 2 I have ngOnInit() function that can be used as jquery's $(document).ready().
I've tries to implement ECharts in a separate page using pure javasript and is working just fine. I even have HTML theme Limitless.
The problem is that I don't know how to get this 'ec' parameter from the code above in Angular2.
Any help would be appreciated! Thank you