VisActor / VisActor/VChart

[Bug] unit disappear when set width of axis

Open
#3,923 0 comments 0 reactions 1 assignee View on GitHub

@xile611 is already working on this.

Since Apr 24, 2025.

bug good first issue VMind
Dominant language
TypeScript
Stars
1.8k
Forks
221
Avg merge
1d 6h
Merged PRs (30d)
26

Description

Version

1.13.9

Link to Minimal Reproduction
Steps to Reproduce
{
  "type": "common",
  "padding": {
    "right": 0,
    "left": 0
  },
  "data": [
    {
      "id": "id0",
      "values": [
        {
          "x": "周一",
          "type": "午餐",
          "y": 25
        },
        {
          "x": "周二",
          "type": "午餐",
          "y": 30
        },
        {
          "x": "周三",
          "type": "午餐",
          "y": 24
        },
        {
          "x": "周四",
          "type": "午餐",
          "y": 25
        },
        {
          "x": "周五",
          "type": "午餐",
          "y": 20
        },
        {
          "x": "周六",
          "type": "午餐",
          "y": 22
        },
        {
          "x": "周日",
          "type": "午餐",
          "y": 19
        }
      ]
    },
    {
      "id": "id1",
      "values": [
        {
          "x": "周一",
          "type": "饮料",
          "y": 100000
        },
        {
          "x": "周二",
          "type": "饮料",
          "y": 2
        },
        {
          "x": "周三",
          "type": "饮料",
          "y": 3
        },
        {
          "x": "周四",
          "type": "饮料",
          "y": 4
        },
        {
          "x": "周五",
          "type": "饮料",
          "y": 5
        },
        {
          "x": "周六",
          "type": "饮料",
          "y": 6
        },
        {
          "x": "周日",
          "type": "饮料",
          "y": 7
        }
      ]
    }
  ],
  "series": [
    {
      "type": "bar",
      "id": "bar",
      "dataIndex": 0,
      "label": {
        "visible": false
      },
      "seriesField": "type",
      "xField": [
        "x",
        "type"
      ],
      "yField": "y",
      "bar": {
        "style": {
          "fill": "#FFCC00"
        }
      }
    },
    {
      "type": "line",
      "id": "line",
      "dataIndex": 1,
      "label": {
        "visible": false
      },
      "seriesField": "type",
      "xField": "x",
      "yField": "y",
      "stack": false,
      "line": {
        "style": {
          "curveType": "monotone",
          "lineDash": [
            2,
            6
          ],
          "stroke": "#000"
        }
      },
      "point": {
        "style": {
          "size": [
            10,
            10
          ],
          "fill": "#000",
          "stroke": "#fff",
          "lineWidth": 2
        }
      }
    }
  ],
  "axes": [
    {
      "orient": "left",
      "seriesIndex": [
        0
      ],
      "width": 50,
      "label": {
        "style": {
          "fill": "#A7ADB2"
        }
      },
      "unit": {
        "visible": true,
        "text": "单位标签",
        "style": {}
      }
    },
    {
      "orient": "right",
      "seriesId": [
        "line"
      ],
      "grid": {
        "visible": false
      },
      "width": "20%",
      "label": {
        "style": {
          "fill": "#A7ADB2"
        }
      },
      "unit": {
        "visible": true,
        "text": "单位标签",
        "style": {
          "textAlign": "left",
          "fill": "#A7ADB2"
        }
      }
    },
    {
      "orient": "bottom",
      "label": {
        "visible": true,
        "style": {
          "fill": "#A7ADB2"
        }
      },
      "type": "band",
      "style": {
        "stroke": "#FF0000"
      },
      "domainLine": {
        "visible": true,
        "style": {
          "stroke": "#DBDEDF"
        }
      }
    }
  ],
  "legends": {
    "visible": true,
    "orient": "top",
    "item": {
      "spaceCol": 40
    }
  }
}
Current Behavior
Image
Expected Behavior
Image
Environment
- OS:
- Browser:
- Framework:
Any additional comments?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.