FastGPT icon indicating copy to clipboard operation
FastGPT copied to clipboard

echarts 带上 formatter 之后显示空白

Open liangxing-mui opened this issue 8 months ago • 2 comments

例行检查

  • [ ] 我已确认目前没有类似 issue
  • [ ] 我已完整查看过项目 README,以及项目文档
  • [ ] 我使用了自己的 key,并确认我的 key 是可正常使用的
  • [ ] 我理解并愿意跟进此 issue,协助测试和提供反馈
  • [x] 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

你的版本

  • [ ] 公有云版本
  • [x] 私有部署版本, 具体版本号: V4.14.5

问题描述, 日志截图,配置文件等 echarts json能支持formatter嘛,我现在带上formatter之后就不能显示了,图表空白。echarts结构如下

{
  "title": {
    "text": "各区域师傅与徒弟数量对比"
  },
  "tooltip": {
    "trigger": "axis",
    "axisPointer": {
      "type": "shadow"
    },
    "formatter": function(params) {
      let result = params[0].name + '<br/>';
      params.forEach(function(item) {
        result += item.marker + item.seriesName + ': ' + item.value + '<br/>';
      });
      return result;
    }
  },
  "legend": {
    "data": ["师傅数量", "徒弟数量"],
    "top": "30"
  },
  "grid": {
    "left": "3%",
    "right": "4%",
    "bottom": "3%",
    "containLabel": true
  },
  "xAxis": {
    "type": "category",
    "data": ["肃片区", "酒泉", "兰州", "肃北"]
  },
  "yAxis": {
    "type": "value",
    "name": "人数"
  },
  "series": [
    {
      "name": "师傅数量",
      "type": "bar",
      "data": [3, 3, 1, 0],
      "itemStyle": {
        "color": "#5470c6"
      }
    },
    {
      "name": "徒弟数量",
      "type": "bar",
      "data": [4, 2, 4, 2],
      "itemStyle": {
        "color": "#91cc75"
      }
    }
  ]
}

复现步骤

预期结果

相关截图

Image

liangxing-mui avatar Mar 10 '26 08:03 liangxing-mui

This issue has not been updated for more than 90 days and is marked as stale. If there is no further activity within 7 days, it will be automatically closed. Please reply to this issue if you need to continue following up on it.

github-actions[bot] avatar Jun 09 '26 05:06 github-actions[bot]

This issue has been automatically closed due to prolonged inactivity (more than 90 days plus a 7-day grace period). If this issue still needs to be resolved, you can reopen it and supplement the relevant information.

github-actions[bot] avatar Jun 16 '26 05:06 github-actions[bot]