ecomfe / echarts-liquidfill

Liquid Fill Chart for Apache ECharts
https://ecomfe.github.io/echarts-liquidfill/example/
BSD 3-Clause "New" or "Revised" License
1.44k stars 621 forks source link

require无法引用liquidFill.js #46

Closed tonny0812 closed 6 years ago

tonny0812 commented 6 years ago

已加载echart4和liquidfill:

paths: {
"jquery"        :   jbasepath+ "/scripts/jquery-1.11.1.min",
'echarts4'         :    basepath+ "/js/echarts/echarts4",
'liquidfill'          :    basepath+ "/js/echarts/echarts-liquidfill"
},
 shim: {
        'jquery' : {
            exports: 'jquery'
        },
               'echarts4' : {
            deps:['jquery'],
            exports: 'echarts4'
        },
        'liquidfill' : {
            deps:['jquery','echarts4'],
            exports: 'liquidfill'
        }
      }

引入插件之后,生成水滴图报错

define(['jquery','echarts4','liquidfill'],function($, echarts, liquidfill) {
        var option = {
                series: [{
                    type: 'liquidFill',
                    data: [0.6],
                    radius: '70%'
                }]
            };
       chart = echarts.init(document.getElementById('chart'));
       chart.setOption(option);
}

报错内容

echarts4.js:11646 Uncaught Error: Component series.liquidFill not exists. Load it first.
    at Function.entity.getClass (echarts4.js:11646)
    at ExtendedClass.<anonymous> (echarts4.js:19832)
    at Array.forEach (<anonymous>)
    at each$1 (echarts4.js:505)
    at ExtendedClass.visitComponent (echarts4.js:19815)
    at Function.entity.topologicalTravel (echarts4.js:17240)
    at ExtendedClass.mergeOption (echarts4.js:19785)
    at ExtendedClass.initBase (echarts4.js:20316)
    at ExtendedClass.resetOption (echarts4.js:19727)
    at ExtendedClass.setOption (echarts4.js:19709)
tonny0812 commented 6 years ago

function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("echarts")); else if(typeof define === 'function' && define.amd) define(["echarts"], factory); else if(typeof exports === 'object') exports["echarts-liquidfill"] = factory(require("echarts")); else root["echarts-liquidfill"] = factory(root["echarts"]); }

需要将“echarts4" 改为“”echarts"