1

嗨,我很难弄清楚 sencha-chart 出了什么问题,这是一个错误还是只是一个语法错误。首先,我有一个使用 extjs 5 的新 sencha-charts 的应用程序。调整后,我想出了可以工作的 ff 代码,问题是当我向它添加监听器时,监听器事件不起作用。请任何人都可以帮我解决这个问题。:

items: [{
        cls: 'chartclass',
        xtype: 'chart',
        flex: 1,
        interactions: [{
        type: 'panzoom',
        zoomOnPanGesture: false,
        axes: {
            left: {
                maxZoom: 1
            }
        }
    }],
        bind: '{chartstore}',
        minHeight: 350,
        animation: true,
        style: 'background: #fff',
        insetPadding: '40px 40px 20px 30px',
        width: '100%',
        height: 500,
        insetPadding: 40,


       interactions: 'itemhighlight',

      axes: [{
        type: 'numeric',
        position: 'left',
        fields: ['utilcost'],
        fontSize: 12,
        grid: true,
        minimum: 0
    }, {
        type: 'category',
        position: 'bottom',
        fields: ['date'],
        label: {
                rotate: {
                    degrees: -90
                }
            }
    }],
     //series
    series: [{
        type: 'bar',        
        xField: ['date'],
        yField: ['utilcost'],
        style: {
                 minGapWidth: 15,
                opacity: 0.80
        },
        highlight: {
                strokeStyle: 'black',
                fillStyle: '#c1e30d',
                lineDash: [5, 3]
        },
         tooltip: {
                trackMouse: true,
                style: 'background: #fff',
                renderer: function(storeItem, item) {
                    var title = item.series.getTitle();
                    this.setHtml(storeItem.get(item.series.getYField()));
                }
            },

         label: {
                field: 'utilcost',
                display: 'insideEnd'
            },
        listeners:{  

                    itemmouseup: function(item){
                    alert('working');
                    }


        }


    }];

控制台日志没有错误。除了触发事件之外,所有元素都在工作。请帮助。我已经尝试了很多解决方案,但这些都不起作用。谢谢

4

0 回答 0