VChart icon indicating copy to clipboard operation
VChart copied to clipboard

[Bug] Can not close the ellpsis of pie chart label

Open kkxxkk2019 opened this issue 1 year ago • 2 comments

Version

lastest

Link to Minimal Reproduction

none

Steps to Reproduce


const spec = {
  "type": "common",
  "color": [
    "#00295C",
    "#2568BD",
    "#9F9F9F",
    "#C5C5C5",
    "#00B0F0",
    "#4BCFFF",
    "#C2C2C2",
    "#D7D7D7"
  ],
  "series": [
    {
      "type": "pie",
      "outerRadius": 0.8,
     
      "label": {
        "visible": true,
        "style": {
          "lineHeight": "100%",
          "fontSize": 30,
          "fontWeight": "bold",
          "fontFamily": "D-Din",
        },
        "overlap": true,
        "smartInvert": true,
        "formatConfig": {
          "content": "dimension"
        },
        "interactive": true,
        layout: {
          strategy: 'none'
        }
      },
      "valueField": "_editor_value_field",
      "categoryField": "_editor_dimension_field",
      "dataId": "0",
      "seriesField": "_editor_dimension_field",
      "id": "series-0"
    }
  ],
  "legends": {
    "id": "legend-discrete",
    "visible": true,
    "autoPage": false,
    "position": "start",
    "interactive": false,
    "item": {
      "label": {
        "style": {
          "fill": "#1F2329",
          "fontSize": 16
        }
      }
    }
  },
  "region": [
    {
      "id": "region-0"
    }
  ],
  "tooltip": {
    "visible": true
  },
  "data": [
    {
      "id": "0",
      "sourceKey": "数值",
      "values": [
        {
          "_editor_dimension_field": "Oranges",
          "_editor_value_field": 61,
          "_editor_type_field": "数值"
        },
        {
          "_editor_dimension_field": "Limes/Lemons",
          "_editor_value_field": 32,
          "_editor_type_field": "数值"
        },
        {
          "_editor_dimension_field": "Other",
          "_editor_value_field": 172,
          "_editor_type_field": "数值"
        }
      ]
    },
    {
      "id": "1",
      "sourceKey": "",
      "values": [
        {
          "_editor_dimension_field": "Oranges",
          "_editor_value_field": null,
          "_editor_type_field": ""
        },
        {
          "_editor_dimension_field": "Limes/Lemons",
          "_editor_value_field": null,
          "_editor_type_field": ""
        },
        {
          "_editor_dimension_field": "Other",
          "_editor_value_field": null,
          "_editor_type_field": ""
        }
      ]
    },
    {
      "id": "2",
      "sourceKey": "",
      "values": [
        {
          "_editor_dimension_field": "Oranges",
          "_editor_value_field": null,
          "_editor_type_field": ""
        },
        {
          "_editor_dimension_field": "Limes/Lemons",
          "_editor_value_field": null,
          "_editor_type_field": ""
        },
        {
          "_editor_dimension_field": "Other",
          "_editor_value_field": null,
          "_editor_type_field": ""
        }
      ]
    },
    {
      "id": "3",
      "sourceKey": "",
      "values": [
        {
          "_editor_dimension_field": "Oranges",
          "_editor_value_field": null,
          "_editor_type_field": ""
        },
        {
          "_editor_dimension_field": "Limes/Lemons",
          "_editor_value_field": null,
          "_editor_type_field": ""
        },
        {
          "_editor_dimension_field": "Other",
          "_editor_value_field": null,
          "_editor_type_field": ""
        }
      ]
    }
  ],
  "markLine": [],
  "markArea": [],
  "labelLayout": "region",
  "width": 640,
  "height": 360,
  "background": "transparent"
};

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

饼图的自动省略无法关闭,pie.style.ellipsis = '' 太 hack,

Expected Behavior

image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

kkxxkk2019 avatar Apr 24 '24 08:04 kkxxkk2019

label.style.ellipsis: false 这样设置是你想要的效果吗? image

xiaoluoHe avatar Apr 25 '24 06:04 xiaoluoHe

期望label有一个无限的画布,只做防重叠,不做阶段 防重叠算法,支持配置viewBox

xile611 avatar Apr 26 '24 09:04 xile611