Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ragava28 opened this issue Jun 15, 2023 · 1 comment

Comments

@ragava28
Copy link

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 ragava28 changed the title heatmap not working using ngx-echarts, but working fine when using echart directly heatmap not working using ngx-echarts 16.0.0, but working fine when using echart 5.4.2 directly Jun 15, 2023
@ragava28
Copy link
Author

@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;
}
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant