生成柱状图的时候js报:Uncaught TypeError: componentType.split is not a functionecharts bar' } ] }, options: config.OptionData }; //#endregion var myChart = echarts.init(document.getElementsByName(config.DivName)[0]); myChart.setOption(option); }, initBarOption: function (title, sourdata, axisData) { return { title: { text: title }, xAxis: [ { 'type': 'category配置项内容和展示

我这个图表是根据官方那个柱状和饼图的组合图的业务,传入Data后走我的公用方法,js报这个错!

配置项如下
      

        var option = {
            baseOption: {
                timeline: {
                    // y: 0,
                    axisType: 'category',
                    // realtime: false,
                    // loop: false,
                    autoPlay: true,
                    // currentIndex: 2,
                    playInterval: 1000,
                    // controlStyle: {
                    //     position: 'left'
                    // },
                    data: config.LegendData
                },
                title: {
                    subtext: config.Subtext
                },
                tooltip: {},
                legend: {
                    x: 'right',
                    data: [config.Title]
                },
                calculable: true,
                grid: {
                    top: 80,
                    bottom: 100
                },
                xAxis: [
                    {
                        'type': 'category',
                        'axisLabel': { 'interval': 0, rotate: 15 },
                        'data': config.AxisData,
                        splitLine: { show: false }
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        name: config.Title
                    }
                ],
                series: [
                    { name: config.Title, type: 'bar' }
                ]
            },
            options: config.OptionData
        };

        //#endregion

        var myChart = echarts.init(document.getElementsByName(config.DivName)[0]);
        myChart.setOption(option);
    },
    initBarOption: function (title, sourdata, axisData) {

        return {
            title: { text: title },
            xAxis: [
                  {
                      'type': 'category',
                      'axisLabel': { 'interval': 0, rotate: 15 },
                      'data': axisData,
                      splitLine: { show: false }
                  }
            ],
            series: [
               { data: sourdata }
            ]
        };
    },
    initBarOptions: function (list) {
        var options = new Array();

        for (var i = 0; i < list.DATA.length; i++) {
            options.push(echartsHelper.initBarOption(list.TITLE[i], list.DATA[i], list.xAxisData[i]));
        }

        return options;
    }

    
截图如下