VChart icon indicating copy to clipboard operation
VChart copied to clipboard

[Bug] title style not work in node-canvas

Open xile611 opened this issue 1 month ago • 0 comments

Version

2.0.8

Link to Minimal Reproduction

no

Steps to Reproduce

{
  "type": "bar",
  "width": 800,
  "height": 600,
  "barMinWidth": 20,
  "barMaxWidth": 50,
  "data": [
    {
      "id": "main",
      "values": [
        {
          "category": "A",
          "series": "S1",
          "value": 10
        },
        {
          "category": "B",
          "series": "S1",
          "value": 20
        },
        {
          "category": "C",
          "series": "S1",
          "value": 30
        },
        {
          "category": "D",
          "series": "S1",
          "value": 15
        },
        {
          "category": "E",
          "series": "S1",
          "value": 25
        },
        {
          "category": "A",
          "series": "S2",
          "value": 15
        },
        {
          "category": "B",
          "series": "S2",
          "value": 25
        },
        {
          "category": "C",
          "series": "S2",
          "value": 35
        },
        {
          "category": "D",
          "series": "S2",
          "value": 20
        },
        {
          "category": "E",
          "series": "S2",
          "value": 22
        }
      ]
    }
  ],
  "series": [
    {
      "type": "bar",
      "xField": "category",
      "yField": "value",
      "seriesField": "series",
      "stack": true,
      "label": {
        "visible": true,
        "position": "inside",
        "style": {
          "fontSize": 11,
          "fill": "#fff"
        }
      }
    }
  ],
  "tooltip": {
    "visible": true
  },
  "legends": {
    "visible": true,
    "orient": "top",
    "position": "middle"
  },
  "title": {
    "visible": true,
    "text": "示例图表111333",
    "orient": "top",
    "align": "center",
    "verticalAlign": "top",
    "textStyle": {
      "fontSize": 16,
      "fill": "#000",
      "fontWeight": "bold",
      "ellipsis": "..."
    }
  }
}

Current Behavior

  1. 浏览器端的渲染结果如下

Image

  1. node-canvas 渲染结果如下:

Image

Expected Behavior

node-canvas 中的标题,在字体大小、样式上都有较大差距

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

xile611 avatar Nov 18 '25 06:11 xile611