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

[Bug] ECharts not integrating in Angular library used in Thingsboard widget #428

Open Younes210701 opened 4 months ago

Younes210701 commented 4 months ago

Version

5.5.1

Link to Minimal Reproduction

https://github.com/apache/echarts

Steps to Reproduce

Since I cannot do a setup to reproduce the issue, i will try to give you the detailed steps to reproduce this issue:

  1. Create an Angular library :
  1. Integrate Echarts in the Angular Library :
import { Component } from '@angular/core';
import { EChartsOption } from 'echarts';

@Component({
  selector: 'w4-echarts',
  templateUrl: './echarts.component.html',
  styleUrls: ['./echarts.component.scss']
})
export class EchartsComponent {
  chartOption: EChartsOption = {
    xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    },
    yAxis: {
      type: 'value',
    },
    series: [
      {
        data: [820, 932, 901, 934, 1290, 1330, 1320],
        type: 'line',
      },
    ],
    tooltip: {
      trigger: 'axis',
    },
  };
}
<div echarts [options]="chartOption" class="demo-chart"></div>
.demo-chart {
    height: 1400px;
  }
  1. Build and export the Angular library (which I called Phoebus):
  1. Use the Angular library (Phoebus) in Thingsboard:
  1. Run the Thingsboard project:

Current Behavior

Expected Behavior

The EChart should render correctly within the Thingsboard widget.

Environment

- OS:Linux Ubuntu 22.04.4 LTS
- Browser: Mozilla Firefox Browser 127.0.2
- Framework:Angular @15.2.10
- Echarts@5.5.1
- Ngx-Echarts@15.0.3

Any additional comments?

Description:

I am experiencing issues integrating ECharts in an Angular library (called Phoebus) that is used as a widget in Thingsboard. When attempting to render the charts, they do not get integrated correctly within the Thingsboard environment. Below are the details of my setup and the steps to reproduce the issue.

Possible Causes:

Steps Taken to Troubleshoot:

image

image

Younes210701 commented 2 months ago

Any news ?