Unknown widget: chart.Charts"

From Documentation
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{ZKChartsEssentialsPageHeader}}
 +
 +
 +
 
= Problem Decription=  
 
= Problem Decription=  
 
You see the error below in a browser developer tool > Console tab:  
 
You see the error below in a browser developer tool > Console tab:  
Line 9: Line 13:
  
 
= Why It Happens =  
 
= Why It Happens =  
ZK fails to instantiate a chart widget because the chart js isn't loaded.
+
ZK fails to instantiate a chart widget because the chart js isn't loaded. (the widget class <code>chart.Charts</code> isn't registered successfully).
  
 
= Possible Causes and Solutions=  
 
= Possible Causes and Solutions=  
 +
There must be something at the client-side affecting the widget registration.
 +
 +
== Load a JavaScript that interferes with widget loading ==
 +
There are possibilities, e.g. if you load highcharts, bootstrap js by yourselves, this might cause an error in chart.wpd and fail the widget registration.
 +
 +
Remove the javascript or resolve the code that interferes zk widget loading can solve this error.
  
 
== Mixing 2 different versions of ZK jar ==
 
== Mixing 2 different versions of ZK jar ==
 +
Please check your jar and just make sure you include one version of ZK jar in one application.
 +
 +
<!-- collect from tickets
 +
#11931, #2925, #11931, #15494
 +
-->
 +
 +
= Debugging Steps =
 +
* Check if chart.wpd is loaded successfully with developer tool > Network tab.
 +
[[File:chart wpd.jpg | center]]
 +
* Check if you include any non-ZK javascript, remove them one by one to find the one that interferes ZK.
 +
  
== Load a JavaScript that Interferce Widget Loading ==
+
{{ZKChartsEssentialsPageFooter}}

Latest revision as of 04:31, 8 November 2022

Unknown widget: chart.Charts



Problem Decription

You see the error below in a browser developer tool > Console tab:

 Uncaught Unknown widget: chart.Charts


Unknown widget chart.png


Why It Happens

ZK fails to instantiate a chart widget because the chart js isn't loaded. (the widget class chart.Charts isn't registered successfully).

Possible Causes and Solutions

There must be something at the client-side affecting the widget registration.

Load a JavaScript that interferes with widget loading

There are possibilities, e.g. if you load highcharts, bootstrap js by yourselves, this might cause an error in chart.wpd and fail the widget registration.

Remove the javascript or resolve the code that interferes zk widget loading can solve this error.

Mixing 2 different versions of ZK jar

Please check your jar and just make sure you include one version of ZK jar in one application.


Debugging Steps

  • Check if chart.wpd is loaded successfully with developer tool > Network tab.
Chart wpd.jpg
  • Check if you include any non-ZK javascript, remove them one by one to find the one that interferes ZK.


< Get Complete Source Code of This Book >


Last Update : 2022/11/08

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.