apex-react-charts
Advanced tools
Comparing version 1.0.0 to 1.0.1
11
index.js
@@ -8,11 +8,10 @@ var React = require('react'); | ||
super(props); | ||
this._cjsContainerId = new window.Date().getTime(); | ||
this.genId = new window.Date().getTime(); | ||
this.options = props.options ? props.options : {}; | ||
this.containerProps = props.containerProps ? props.containerProps : {width: "100%", position: "relative"}; | ||
this.containerProps.height = props.containerProps && props.containerProps.height || this.options.height || "100%"; | ||
this.chartContainerId = "apexchart-container-" + this._cjsContainerId; | ||
this.style = props.style || {width: "100%", height: "100%", position: "relative"}; | ||
this.chartContainerId = "apexchart-container-" + this.genId; | ||
} | ||
componentDidMount() { | ||
//Create Chart and Render | ||
this.chart = new Apex(document.querySelector(this.chartContainerId), this.options); | ||
this.chart = new Apex(document.querySelector('#' + this.chartContainerId), this.options); | ||
this.chart.render(); | ||
@@ -39,3 +38,3 @@ | ||
render() { | ||
return React.createElement('div', { id: this.chartContainerId, style: this.containerProps }); | ||
return React.createElement('div', { id: this.chartContainerId, style: this.style }); | ||
@@ -42,0 +41,0 @@ } |
{ | ||
"name": "apex-react-charts", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A React Component Wrapper for ApexCharts", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
436493
42