Is it possible to add title to charts?

后端 未结 5 1360
傲寒
傲寒 2021-02-13 12:39

I want to add a title to a chart, like in the gauge example or a pie chart. I want to display a title under or on top of the chart. Is this possible? I\'ve been looking and can\

5条回答
  •  -上瘾入骨i
    2021-02-13 13:15

    Since Ext.chart.Chart is an Ext.draw.Component, you can add sprites as items of it. Try to use this:

    Ext.create('Ext.chart.Chart', {
       default chart settings here
    
       ...
    
       items: [{
          type  : 'text',
          text  : 'Simple Title',
          font  : '14px Arial',
          width : 100,
          height: 30,
          x : 50, //the sprite x position
          y : 10  //the sprite y position
       }]
    })
    

提交回复
热议问题