VisActor/VChart

[Bug] keyTimeFormat of tooltip not work

Open

#3.928 geöffnet am 24. Apr. 2025

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (1 zugewiesene Person)TypeScript (212 Forks)user submission
VMindbuggood first issue

Repository-Metriken

Stars
 (1.800 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 3T 12h) (15 gemergte PRs in 30 T)

Beschreibung

Version

1.13.9

Link to Minimal Reproduction

no

Steps to Reproduce

const spec = {
  "type": "line",
  "data": {
    "values": [
      {
        "time": "1744859339559",
        "value": 8
      },
      {
        "time": "1744859349559",
        "value": 9
      },
      {
        "time": "1744859359559",
        "value": 11
      },
      {
        "time": "1744859369559",
        "value": 14
      },
      {
        "time": "1744859379559",
        "value": 16
      }
    ]
  },
  "xField": "time",
  "yField": "value",
  "axes": [
    {
      "orient": "bottom",
      "_alias_name": "xAxis",
      "label": {
        "formatMethod": function (label) { return new Date(Number(label)).toLocaleString(); }
      }
    }
  ],
  tooltip: {
    dimension: {
      content: [{
        keyTimeFormat: 'yyyy-MM-dd HH:mm:ss'
      }]
    }
  }
};

Current Behavior

Expected Behavior

tooltip中的key应该显示成时间字符串

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Contributor Guide