Ext图表自动调整大小

时间:2012-11-22 18:16:56

标签: extjs charts

我正在尝试制作图表(分机4.1):

    var chart = Ext.create('Ext.chart.Chart', {
    width: 280,
    height: 230,
    animate: true,
    autoSize: true,
    shadow: true,
    store: storeChart2,
    renderTo: 'chart2',
    legend: {
//position: 'right'
    },
    theme: 'Base:gradients',
    series: [{
        type: 'pie',
        field: 'data',
        showInLegend: false,
        highlight: {
          segment: {
            margin: 20
          }
        },
         tips: {
                  trackMouse: true,
          width: 100,
                  renderer: function(storeItem, item) {
                    this.setTitle(storeItem.get('name') + ': ' + Math.round(all * storeItem.get('data') / 100) +' ('+ Math.round(storeItem.get('data') / 100 * 100) + '%)');
                  }
                },
        label: {
            field: 'name',
            display: 'rotate',
            contrast: true,
            font: '12px Arial'
        }
    }]
});

AutoSize:是的, - 不起作用。在Chrome控制台中:

Error: Invalid value for <svg> attribute width="-Infinity"
Error: Invalid value for <svg> attribute height="-Infinity"

怎么了?

1 个答案:

答案 0 :(得分:0)

尝试添加属性

  

最低:0

请参阅此post