xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.11k stars 197 forks source link

heatmap not working using ngx-echarts 16.0.0, but working fine when using echart 5.4.2 directly #402

Open ragava28 opened 1 year ago

ragava28 commented 1 year ago

https://codepen.io/ragava28/pen/oNQbddg?editors=0010 in above example , we are using echart 5.4.2 and able to add multiple value axis to heat map & it is working fine .

but when we use same option object run it using ngx-echart 16.0.0 , we are getting below error . image

Can you please help.

ragava28 commented 1 year ago

@xieziyu , Can you please help , below is our simple code angular code. when we change type to "category", every thing works fine, but giving error when change it to "value" or "time".

`import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';

@Component({ selector: 'app-root', template: `<div echarts [options]="options" (chartInit)="onChartInit($event)"

chartContainerRef

          ></div>`,

styleUrls: ['./app.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class AppComponent implements OnInit { chartInstance: any; public options: any; constructor(private cdr: ChangeDetectorRef) { } ngOnInit(): void { this.options = { tooltip: {}, xAxis: { type: "value" }, yAxis: { type: "value" }, visualMap: { min: 0, max: 1, inRange: { color: [ "#313695", "#4575b4", "#74add1", "#abd9e9", "#e0f3f8", "#ffffbf", "#fee090", "#fdae61", "#f46d43", "#d73027", "#a50026" ] } }, series: [ { name: "Gaussian", type: "heatmap", data: [ [1, 1, 1], [2, 2, 2], [3, 3, 3], [4, 4, 4], [5, 5, 5], [6, 6, 6] ], } ] };
this.cdr.markForCheck(); } onChartInit(eChartInstance: Event) { this.chartInstance = eChartInstance; } } `