Skip to content

[Feature] 横向柱状图能否设置左侧起点从10开始 #18914

@zhouzhili

Description

@zhouzhili

What problem does this feature solve?

我有一个横向柱状图,它有一个背景边框,但是目前无法配置柱状图和左侧边框间的间距,有什么办法可以设置吗?
我的option 如下:

option = {
  xAxis: {
    type: 'value',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  },
  yAxis: {
    type: 'category',
    show:false,
  },
  series: [
    {
      name:'bar',
      data: [120, 200, 150, 80, 70, 110, 130],
      type: 'bar',
      barWidth:10,
      itemStyle: {
				borderRadius: 5, 
			},
    },
    {
      name:'bg',
      data: [200, 200, 200, 200, 200, 200, 200],
      type: 'bar',
      barWidth:15,
      barGap: '-125%',
      itemStyle: {
				borderRadius: 5,
				color:'rgba(0,0,0,0)',
				borderColor:'green'
			},
			z:-1
    }
  ]
};

在线示例如下:
https://codepen.io/zhili124/pen/XWyYgWE
image
想达到的效果是蓝色柱子和绿色边框的左侧有一定的间距

What does the proposed API look like?

比如bar可以设置offset:[10,10],或者其他可以实现的方法

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions