-
Bug
-
Resolution: Fixed
-
Blocker
-
10.3.3.0
-
Security Level: Jimmy
-
None
Steps to Reproduce
Load a page including a chart
Current Result
chart.wpd contains all content from the zk.wpd provided in chart package
Expected Result
on-demand client-side exporting libraries are only loaded if the browser request them
Debug Information
https://www.highcharts.com/docs/export-module/client-side-export
https://api.highcharts.com/highcharts/exporting.libURL
Highcharts includes external libraries for client-side exporting.
These libraries include CanVG, jsPDF and svg2pdf.js,
In a standard highcharts (JS + html) deployement, these libraries are loaded on demand if the specific client request them. (canvg is used as a sort of polyfill for IE exporting PNGs for example)
In ZKChart, these external libraries are front loaded
In addition, canvg modifies the Array.from function.
This causes incompatibilities with google maps API v4, so loading it by default is counter-productive.
Highcharts provide a libURL option which can be used to target the folder containing the JS files for the libraries.
This should point out to zkau/web/[hash]/js/chart/ext/lib/ which is the location of these files in ZK charts
Workaround
There are 2 possible workarounds
Version replacement in gmap (for gmap compatibility specifically)
First possible workaround, use a lower API version for gmaps
<gmaps version="3.25" ...
patch in charts
2nd possible workaround, zk.wpd replacement for chart
attached replacement for /src/main/resources/web/js/chart/zk.wpd
+
declare libURI in java config
chart.getExporting().addExtraAttr("libURL",new org.zkoss.json.JavaScriptValue("'"+Executions.getCurrent().getContextPath() + "/zkau/web/_zv11.2.0.0/js/chart/ext/lib/'"));
- relates to
-
ZKCHARTS-152 Chart overrides default highcharts methods, doesn't match current API
- Open
-
ZKCHARTS-154 Uncaught TypeError: (new Promise(...)).finally is not a function
- Closed