Vanessa219 / vditor

♏ 一款浏览器端的 Markdown 编辑器,支持所见即所得(富文本)、即时渲染(类似 Typora)和分屏预览模式。An In-browser Markdown editor, support WYSIWYG (Rich Text), Instant Rendering (Typora-like) and Split View modes.
https://b3log.org/vditor
MIT License
8.27k stars 853 forks source link

ReferenceError: echarts is not defined #1657

Closed suiquantong closed 1 month ago

suiquantong commented 1 month ago

编辑模式

静态预览模式

描述问题

页面老提示找不到echarts
版本:"vue": "^3.4.19", echarts:^5.5.1

```echarts
{
    "title": {
        "text": "2021年第一季度青岛市各区市GDP"
    },
    "tooltip": {
        "trigger": "axis"
    },
    "legend": {
        "data": ["GDP"]
    },
    " xAxis": {
        "type": "category",
        "data": ["莱西", "市南", "市北", "李沧", "崂山", "黄岛", "城阳", "即墨", "胶州", "平度"]
    },
    " yAxis": {
        "type": "value"
    },
    "series": [{
        "name": "GDP",
        "type": "bar",
        "data": [94.42, 73.44, 52.45, 62.95, 41.96, 31.47, 20.98, 10.49, 104.91, 83.93]
    }]
}


### 期待的结果

<!-- 请尽量清晰精准地描述你所期待的结果。-->

### 截屏或录像
![image](https://github.com/user-attachments/assets/34534625-a0f4-42ea-bf32-dbcc853e8e0b)

<!-- 
如果可能,请尽量附加截图或录像来描述你遇到的问题。

(Windows 下推荐使用 [Screen2Gif](https://www.screentogif.com/) 进行录屏。如果是编辑器输入相关问题,使用 Screen2Gif 录制结束后请打开`图像 - 按键`)
-->

### 版本信息

* 版本:   "vditor": "^3.10.4",
* 操作系统: windows
* 浏览器: chrome

### 其他信息

<!-- 请提供其他附加信息帮助我们诊断问题。 -->
Vanessa219 commented 1 month ago

估计是数据不对,可参考

{
  "title": { "text": "最近 30 天" },
  "tooltip": { "trigger": "axis", "axisPointer": { "lineStyle": { "width": 0 } } },
  "legend": { "data": ["帖子", "用户", "回帖"] },
  "xAxis": [{
      "type": "category",
      "boundaryGap": false,
      "data": ["2019-05-08","2019-05-09","2019-05-10","2019-05-11","2019-05-12","2019-05-13","2019-05-14","2019-05-15","2019-05-16","2019-05-17","2019-05-18","2019-05-19","2019-05-20","2019-05-21","2019-05-22","2019-05-23","2019-05-24","2019-05-25","2019-05-26","2019-05-27","2019-05-28","2019-05-29","2019-05-30","2019-05-31","2019-06-01","2019-06-02","2019-06-03","2019-06-04","2019-06-05","2019-06-06","2019-06-07"],
      "axisTick": { "show": false },
      "axisLine": { "show": false }
  }],
  "yAxis": [{ "type": "value", "axisTick": { "show": false }, "axisLine": { "show": false }, "splitLine": { "lineStyle": { "color": "rgba(0, 0, 0, .38)", "type": "dashed" } } }],
  "series": [
    {
      "name": "帖子", "type": "line", "smooth": true, "itemStyle": { "color": "#d23f31" }, "areaStyle": { "normal": {} }, "z": 3,
      "data": ["18","14","22","9","7","18","10","12","13","16","6","9","15","15","12","15","8","14","9","10","29","22","14","22","9","10","15","9","9","15","0"]
    },
    {
      "name": "用户", "type": "line", "smooth": true, "itemStyle": { "color": "#f1e05a" }, "areaStyle": { "normal": {} }, "z": 2,
      "data": ["31","33","30","23","16","29","23","37","41","29","16","13","39","23","38","136","89","35","22","50","57","47","36","59","14","23","46","44","51","43","0"]
    },
    {
      "name": "回帖", "type": "line", "smooth": true, "itemStyle": { "color": "#4285f4" }, "areaStyle": { "normal": {} }, "z": 1,
      "data": ["35","42","73","15","43","58","55","35","46","87","36","15","44","76","130","73","50","20","21","54","48","73","60","89","26","27","70","63","55","37","0"]
    }
  ]
}