G2 icon indicating copy to clipboard operation
G2 copied to clipboard

横向柱图,axis title无法设置textAlign,title始终居中

Open yuyangvi opened this issue 9 years ago • 8 comments

yuyangvi avatar Apr 19 '17 13:04 yuyangvi

可以设置的。

chart.axis('genre', {
  title: {
    textAlign: 'left' // textAlign 属性可取值 left right center
  }
});```

simaQ avatar Apr 20 '17 06:04 simaQ

fireshot capture 56 - g2 - - https___antv alipay com_g2_demo_04-bar_h-bar html

yuyangvi avatar Apr 21 '17 03:04 yuyangvi

因为保留了 title, 文本的展示空间就会设定在title和坐标轴线之间,这个时候,你需要加大 titleOffset,

snip20170421_7

chart.axis('province',{
        //title: null
        titleOffset: 100, // 标题距离坐标轴线的距离,默认是 60
        labelOffset: 90 , // 文本距离坐标轴线的距离,默认是 13
        labels: {
          autoRotate: false, // 关闭自动旋转功能
          label: {
            textAlign: 'left'
          }
        }
      });

snip20170421_8

simaQ avatar Apr 21 '17 04:04 simaQ

title 的话确实旋转不了。。。,考虑支持

simaQ avatar Apr 21 '17 04:04 simaQ

echart支持 旋转的,需求还是蛮强烈的,希望支持

lcoder avatar Dec 24 '17 12:12 lcoder

G2 3.0 版本支持了 https://antv.alipay.com/zh-cn/g2/3.x/api/chart.html#_axis

simaQ avatar Dec 24 '17 13:12 simaQ

@simaQ 这个链接不存在了吗,它直接跳转到antv的首页啦??

preservance717 avatar Sep 10 '19 06:09 preservance717

@simaQ 这个链接不存在了吗,它直接跳转到antv的首页啦??

AntV 的文档都已迁移至语雀,https://www.yuque.com/antv/g2-docs/api-chart#ef1eaedc

simaQ avatar Sep 10 '19 06:09 simaQ