The ec returned from
<div
echarts
[options]="chartOptions || defaultOptions"
(chartInit)="onChartInit($event)"
></div>
example-chart.component.ts
export class ExampleChartComponent {
@Input() chartOptions!: EChartsOption;
initOpts = {
renderer: 'svg',
width: 608,
height: 302,
};
defaultOptions = DefaultOptions as EChartsOption;
onChartInit(chartInstance: any) {
console.log(chartInstance);
}
}
console logs out as:
id: "ec_1687258340364"
resize: ƒ ()
_$eventProcessor: ECEventProcessor {}
__ec_primitive__: true
__flagInMainProcess: false
__pendingUpdate: null
_api: class_1 {getDom: ƒ, getZr: ƒ, getWidth: ƒ, getHeight: ƒ, getDevicePixelRatio: ƒ, …}
_chartsMap: {_ec_series00_series.line: LineView, _ec_series10_series.line: LineView,
...etc
where _api has the method I want (getOption()) but isn't really "available" to be executed.