【问题标题】:Ho to set a maximum bar chart height in ext js column charts?如何在 ext js 柱形图中设置最大条形图高度?
【发布时间】:2016-12-30 14:42:11
【问题描述】:

我正在使用具有 x、y 位置的项目来显示图表的子标题。 但是条高超过了标题如何在此处设置默认的最大条高

【问题讨论】:

  • 你能显示一些代码吗?检查此链接,您可以在其中使用条形高度:docs.sencha.com/extjs/5.1.2/api/Ext.chart.series.Bar.html
  • iam using ext js 4.2.0 { type : 'text', text : "chartTitle",// 显示标题字体 : '15px Helvetica', width : 300, height: 20, x : 35 , // sprite x 位置 y : 10 // sprite y 位置 } 我的条形高度与这个标题重叠
  • 渲染器:函数(精灵,记录,属性,索引,存储){ if(attr.height>=27) { attr.height=attr.height-27;属性.y=属性.y+27;通过使用此代码,我们可以设置条的最大高度是否正确???

标签: extjs extjs4 extjs4.2 extjs5


【解决方案1】:
renderer: function(sprite, record, attr, index, store) 
{ 
 if(attr.height>=27)
      { 
       attr.height=attr.height-27;
       attr.y=attr.y+27; 
      }
 } 
//By using this code we can set maximum height of bar is it correct

【讨论】: