VisActor / VChart

VChart, more than just a cross-platform charting library, but also an expressive data storyteller.
https://www.visactor.io/vchart
MIT License
915 stars 62 forks source link

[Bug] 饼图数据为空时标签缺省显示 #2853

Closed FunctionEurus closed 3 months ago

FunctionEurus commented 3 months ago

Version

1.11.5

Link to Minimal Reproduction

none

Steps to Reproduce

const spec = {
  type: 'pie',
  data: [
    {
      values: [
        { type: 'oxygen', value: 0 },
        { type: 'silicon', value: 0 },
        { type: 'aluminum', value: 0 },
        { type: 'iron', value: 0 },
        { type: 'calcium', value: 0 },
        { type: 'sodium', value: 0 }
      ]
    }
  ],
  valueField: 'value',
  categoryField: 'type',
  label: {
    visible: true
  }
};

const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;

Current Behavior

curr

Expected Behavior

expect

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

xiaoluoHe commented 3 months ago

试一下配置:

label: {
    visible: true,
    layout:{
      tangentConstraint: false // 关闭布局时的切线约束
    }
  }

image