是否可以向图表添加标题? [英] Is it possible to add title to charts?

查看:632
本文介绍了是否可以向图表添加标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为图表添加标题,例如示例或饼图。我想在图表下方或上方显示标题。这可能吗?我一直在寻找,找不到任何关于这一点。如果是这样,任何提示分享?
它会像这样

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

:我发现有一个属性可以为例外情况下的标题或任何标签创建文字精灵。绘制包
但我不能理解如何使用它。

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这里也做了同样的事吗?

anybdy here have done the same?

推荐答案

由于Ext.chart.Chart是一个Ext.draw.Component,你可以添加精灵作为它的项目。尝试使用:

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
   }]
})

这篇关于是否可以向图表添加标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆