Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add title to charts?

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't find anything about this. if so , any tip to share? it would be something like this  gauge with titles

EDIT: i found there is a property to create text sprites for the title or any labels at the Ex.draw package. but i couldnt understand how to use it..

anybdy here have done the same?

like image 505
Armance Avatar asked Jun 16 '11 14:06

Armance


1 Answers

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
   }]
})
like image 178
Gabriel Oliveira Avatar answered Sep 18 '22 23:09

Gabriel Oliveira