最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Ext JS 6 - Charts are not found despite including ext-all.js - Stack Overflow

programmeradmin4浏览0评论

Despite that I included ext-all.js file in my index page; getting error like below when I try this online Guage chart example provided by Sencha

.js?_dc=1436970370848 404 (Not Found)
Uncaught Error: [Ext.create] Unrecognized class name / alias: widget.polar

Despite that I included ext-all.js file in my index page; getting error like below when I try this online Guage chart example provided by Sencha

http://myapp./widget/polar.js?_dc=1436970370848 404 (Not Found)
Uncaught Error: [Ext.create] Unrecognized class name / alias: widget.polar
Share Improve this question edited Sep 7, 2015 at 19:07 Tarabass 3,1522 gold badges18 silver badges35 bronze badges asked Jul 15, 2015 at 14:32 talha06talha06 6,46624 gold badges99 silver badges154 bronze badges
Add a ment  | 

6 Answers 6

Reset to default 6

The charts are in a separated package:

Sencha Charts are not included in the Ext JS library by default. In order to include the charts package, simply add “charts” (“sencha-charts” if working with Ext JS 5.x) to the requires block in your Sencha Cmd generated application’s {appRoot}/app.json file. Adding a package name to the requires array directs Cmd to make the package available to your application.

https://docs.sencha./extjs/5.1/ponents/introduction_to_charting.html

"requires": [
    "charts"
],

This should be unmented from your app.json

In Extjs 6, you have to include sencha charts by unmenting

"requires": [
        "sencha-charts"
    ],

in app.json and the run sencha app watch mand in sencha cmd through application folder.

It works for me, hope this will be helpful to you :)

I had exactly same problem in rendering polar charts.Found out below solution: Add below in application.js

requires: ['Ext.chart.*']

In addition to unmenting "required" : 'Charts' ('charts' for ExtJS 6, and 'sencha-charts' for ExtJS 5) that works well for Sencha Cmd projects, I see that you include ext-all.js files by yourself. Probably you need to find them... you can find all files there ->

https://cdnjs./libraries/extjs/6.2.0 All ExtJS files, used for including. That may be used for online linking (in jsfiddle, for example). Write at the end 6.1.0, 6.0.0, 5.1.0 or any version you need.

Found within this linkage example https://www.sencha./forum/showthread.php?303990-Is-there-a-free-GPA-CDN-for-ExtJS-6-l&p=1115697&viewfull=1#post1115697
In jsfiddle - https://jsfiddle/Elunyfay/7v0uo2w6/7/

<!DOCTYPE html><html>
<head>
<script type="text/javascript" src="http://cdnjs.cloudflare./ajax/libs/extjs/6.0.0/ext-all-debug.js"></script>

<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare./ajax/libs/extjs/6.0.0/classic/theme-triton/resources/theme-triton-all-debug.css">
<script type="text/javascript" src="http://cdnjs.cloudflare./ajax/libs/extjs/6.0.0/classic/theme-triton/theme-triton-debug.js"></script>

<script type="text/javascript" src="http://cdnjs.cloudflare./ajax/libs/extjs/6.0.0/packages/charts/classic/charts-debug.js"></script>
<link type="text/css" href="http://cdnjs.cloudflare./ajax/libs/extjs/6.0.0/packages/charts/classic/classic/resources/charts-all-debug.css">
...

For ExtJS 6.x using open tooling - you have to install charts module manually

npm install @sencha/ext-charts

(do not use -g flag because Sencha CMD searches for files in the source folder)

and than add

"requires": [
    "charts"
],

to your app.json file.

发布评论

评论列表(0)

  1. 暂无评论