apexcharts
Advanced tools
Comparing version 1.4.4 to 1.4.5
{ | ||
"name": "apexcharts", | ||
"description": "A JavaScript Chart Library", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"main": "dist/apexcharts.min.js", | ||
@@ -6,0 +6,0 @@ "directories": { |
@@ -486,2 +486,16 @@ import Annotations from './modules/Annotations' | ||
/** | ||
* Allows the user to provide data attrs in the element and the chart will render automatically when this method is called by searching for the elements containing 'data-apexcharts' attribute | ||
*/ | ||
static initOnLoad () { | ||
const els = document.querySelectorAll('[data-apexcharts]') | ||
for (let i = 0; i < els.length; i++) { | ||
const el = els[i] | ||
const options = JSON.parse(els[i].getAttribute('data-options')) | ||
const apexChart = new ApexCharts(el, options) | ||
apexChart.render() | ||
} | ||
} | ||
/** | ||
* This static method allows users to call chart methods without necessarily from the | ||
@@ -488,0 +502,0 @@ * instance of the chart in case user has assigned chartID to the targetted chart. |
@@ -13,3 +13,3 @@ /* | ||
static isObject (item) { | ||
return (item && typeof item === 'object' && !Array.isArray(item) && item !== null) | ||
return (item && typeof item === 'object' && !Array.isArray(item) && item != null) | ||
} | ||
@@ -16,0 +16,0 @@ |
Sorry, the diff of this file is too big to display
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
1310927
16725