-
-
Couldn't load subscription status.
- Fork 1.4k
Closed
Description
Great lib! Anyways, I'm not able to use it in new project which is based on web-components with LitElement. It's throwing this error:
DetectElementResize.js:79 Uncaught (in promise) TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
at push../node_modules/apexcharts/src/utils/DetectElementResize.js.window.addResizeListener (DetectElementResize.js:79)
at apexcharts.js:113
at new Promise (<anonymous>)
at ApexCharts.render (apexcharts.js:90)
at HTMLElement.<anonymous> (hs-line-chart.ts:29)
Code example:
import { LitElement, html } from 'lit-element';
import ApexCharts from 'apexcharts';
class LineChart extends LitElement {
static get is() {
return 'line-chart';
}
async renderChart() {
await this.updateComplete;
var options = {
theme: 'dark',
chart: {
type: 'line',
},
series: [{
name: 'sales',
data: [30,40,35,50,49,60,70,91,125]
}],
xaxis: {
categories: [1991,1992,1993,1994,1995,1996,1997, 1998,1999]
}
}
var chart = new ApexCharts(this.shadowRoot.querySelector("#container"), options);
chart.render();
}
render() {
return html`<div id="container"></div>`;
}
}
window.customElements.define(LineChart.is, LineChart);
export default LineChart;Metadata
Metadata
Assignees
Labels
No labels