VisActor/VChart

[Bug] unit disappear when set width of axis

Open

#3923 aperta il 24 apr 2025

Vedi su GitHub
 (0 commenti) (0 reazioni) (1 assegnatario)TypeScript (212 fork)user submission
VMindbuggood first issue

Metriche repository

Star
 (1800 star)
Metriche merge PR
 (Merge medio 3g 12h) (15 PR mergiate in 30 g)

Descrizione

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

Expected Behavior

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Guida contributor