siyuan-note / siyuan

A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang.
https://b3log.org/siyuan
GNU Affero General Public License v3.0
23.03k stars 1.62k forks source link

echart显示空白,没有显示报错 #13103

Closed Littleweisheit closed 2 weeks ago

Littleweisheit commented 2 weeks ago

Is there an existing issue for this?

Can the issue be reproduced with the default theme (daylight/midnight)?

Could the issue be due to extensions?

Describe the problem

把echart实例https://echarts.apache.org/examples/zh/editor.html?c=sunburst-borderRadius 用chatgpt转json后导入思源

{
  "data": [
    {
      "name": "Grandpa",
      "children": [
        {
          "name": "Uncle Leo",
          "value": 15,
          "children": [
            {
              "name": "Cousin Jack",
              "value": 2
            },
            {
              "name": "Cousin Mary",
              "value": 5,
              "children": [
                {
                  "name": "Jackson",
                  "value": 2
                }
              ]
            },
            {
              "name": "Cousin Ben",
              "value": 4
            }
          ]
        },
        {
          "name": "Father",
          "value": 10,
          "children": [
            {
              "name": "Me",
              "value": 5
            },
            {
              "name": "Brother Peter",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "name": "Nancy",
      "children": [
        {
          "name": "Uncle Nike",
          "children": [
            {
              "name": "Cousin Betty",
              "value": 1
            },
            {
              "name": "Cousin Jenny",
              "value": 2
            }
          ]
        }
      ]
    }
  ],
  "option": {
    "series": {
      "type": "sunburst",
      "data": "data",
      "radius": [60, "90%"],
      "itemStyle": {
        "borderRadius": 7,
        "borderWidth": 2
      },
      "label": {
        "show": false
      }
    }
  }
}

Expected result

显示这个图表 图片

Screenshot or screen recording presentation

下面空白处 图片

Version environment

- Version: 3.1.10
- Operating System: Win11
- Browser (if used):

Log file

I 2024/11/10 12:13:19 conf.go:598: exiting kernel [force=false, setCurrentWorkspace=true, execInstallPkg=0] I 2024/11/10 12:13:19 sync.go:193: sync before exit I 2024/11/10 12:13:19 repository.go:1285: syncing data repo [device=3635fde5-930d-4691-8cb5-6be86775988c, kernel=w2ahe72, provider=3, mode=a/false] I 2024/11/10 12:13:19 ref.go:50: got local latest [device=3635fde5-930d-4691-8cb5-6be86775988c/windows, id=fccecf49a3d1bef13816562a53d69f7dd32a2815, files=557, size=83.49 MB, created=2024-11-10 12:03:44] I 2024/11/10 12:13:19 repo.go:591: walk data [files=557] cost [33.1004ms] I 2024/11/10 12:13:19 ref.go:50: got local latest [device=3635fde5-930d-4691-8cb5-6be86775988c/windows, id=fccecf49a3d1bef13816562a53d69f7dd32a2815, files=557, size=83.49 MB, created=2024-11-10 12:03:44] I 2024/11/10 12:13:19 ref.go:64: updated local latest to [device=3635fde5-930d-4691-8cb5-6be86775988c/windows, id=3ae0b591fd50bbbc38d667f67aa32a9da4e720bc, files=557, size=83.49 MB, created=2024-11-10 12:13:19] I 2024/11/10 12:13:25 webdav.go:92: uploaded object [Notes/siyuan/repo/lock-sync] I 2024/11/10 12:13:25 ref.go:50: got local latest [device=3635fde5-930d-4691-8cb5-6be86775988c/windows, id=3ae0b591fd50bbbc38d667f67aa32a9da4e720bc, files=557, size=83.49 MB, created=2024-11-10 12:13:19] I 2024/11/10 12:13:26 webdav.go:104: downloaded object [Notes/siyuan/repo/refs/latest] I 2024/11/10 12:13:26 webdav.go:104: downloaded object [Notes/siyuan/repo/indexes/fccecf49a3d1bef13816562a53d69f7dd32a2815] I 2024/11/10 12:13:26 sync.go:1581: got cloud latest [device=3635fde5-930d-4691-8cb5-6be86775988c/windows, id=fccecf49a3d1bef13816562a53d69f7dd32a2815, files=557, size=83.49 MB, created=2024-11-10 12:03:44] I 2024/11/10 12:13:26 sync.go:1325: upsert file [76868cb7aea02e995ff003c126583df0c7197c57, /20241108170119-b6b4fre/20241108170322-zfpujks/20241108170322-qy7gfih/20241108170322-h4bm9jg/20241110112902-7y096rj.sy, 2024-11-10 12:12:58] chunk [c838cdbdc083575b539468a2dd33e6c2ccc44309] I 2024/11/10 12:13:26 sync.go:1341: upsert chunk [c838cdbdc083575b539468a2dd33e6c2ccc44309] I 2024/11/10 12:13:27 webdav.go:92: uploaded object [Notes/siyuan/repo/objects/c8/38cdbdc083575b539468a2dd33e6c2ccc44309] I 2024/11/10 12:13:27 sync.go:1261: uploaded chunk [objects/c8/38cdbdc083575b539468a2dd33e6c2ccc44309, 1/1] I 2024/11/10 12:13:28 webdav.go:92: uploaded object [Notes/siyuan/repo/objects/76/868cb7aea02e995ff003c126583df0c7197c57] I 2024/11/10 12:13:28 sync.go:1207: uploaded file [objects/76/868cb7aea02e995ff003c126583df0c7197c57, 1/1] I 2024/11/10 12:13:28 sync.go:221: got local latest [3ae0b591fd50bbbc38d667f67aa32a9da4e720bc] files [557] I 2024/11/10 12:13:28 sync.go:1454: got latest sync [device=3635fde5-930d-4691-8cb5-6be86775988c/windows, id=fccecf49a3d1bef13816562a53d69f7dd32a2815, files=557, size=83.49 MB, created=2024-11-10 12:03:44] I 2024/11/10 12:13:28 sync.go:228: got latest sync [fccecf49a3d1bef13816562a53d69f7dd32a2815] files [557] I 2024/11/10 12:13:28 diff.go:49: upsert [lID=b6d81901a3deaaaf454722b58e57165a116e1054, lPath=/20241108170119-b6b4fre/20241108170322-zfpujks/20241108170322-qy7gfih/20241108170322-h4bm9jg/20241110112902-7y096rj.sy, lUpdated=2024-11-10 12:03:11, rID=76868cb7aea02e995ff003c126583df0c7197c57, rPath=/20241108170119-b6b4fre/20241108170322-zfpujks/20241108170322-qy7gfih/20241108170322-h4bm9jg/20241110112902-7y096rj.sy, rUpdated=2024-11-10 12:12:58] I 2024/11/10 12:13:28 sync.go:239: cloud upsert [b6d81901a3deaaaf454722b58e57165a116e1054, /20241108170119-b6b4fre/20241108170322-zfpujks/20241108170322-qy7gfih/20241108170322-h4bm9jg/20241110112902-7y096rj.sy, 2024-11-10 12:03:11] I 2024/11/10 12:13:28 sync.go:245: local upsert [76868cb7aea02e995ff003c126583df0c7197c57, /20241108170119-b6b4fre/20241108170322-zfpujks/20241108170322-qy7gfih/20241108170322-h4bm9jg/20241110112902-7y096rj.sy, 2024-11-10 12:12:58] I 2024/11/10 12:13:28 webdav.go:104: downloaded object [Notes/siyuan/repo/indexes-v2.json] I 2024/11/10 12:13:28 webdav.go:104: downloaded object [Notes/siyuan/repo/refs/latest] I 2024/11/10 12:13:29 webdav.go:92: uploaded object [Notes/siyuan/repo/indexes-v2.json] I 2024/11/10 12:13:29 webdav.go:92: uploaded object [Notes/siyuan/repo/indexes/3ae0b591fd50bbbc38d667f67aa32a9da4e720bc] I 2024/11/10 12:13:29 sync.go:1172: uploaded index [device=3635fde5-930d-4691-8cb5-6be86775988c/windows, id=3ae0b591fd50bbbc38d667f67aa32a9da4e720bc, files=557, size=83.49 MB, created=2024-11-10 12:13:19] I 2024/11/10 12:13:31 webdav.go:92: uploaded object [Notes/siyuan/repo/refs/latest] I 2024/11/10 12:13:31 webdav.go:104: downloaded object [Notes/siyuan/repo/refs/latest] I 2024/11/10 12:13:31 sync.go:1382: updated latest sync [device=3635fde5-930d-4691-8cb5-6be86775988c/windows, id=3ae0b591fd50bbbc38d667f67aa32a9da4e720bc, files=557, size=83.49 MB, created=2024-11-10 12:13:19] I 2024/11/10 12:13:32 webdav.go:116: removed object [Notes/siyuan/repo/lock-sync] I 2024/11/10 12:13:32 repository.go:1353: synced data repo [device=3635fde5-930d-4691-8cb5-6be86775988c, kernel=w2ahe72, provider=3, mode=a/false, ufc=4, dfc=3, ucc=1, dcc=0, ub=33.05 kB, db=28.54 kB] in [12.55s], merge result [conflicts=0, upserts=0, removes=0]

I 2024/11/10 12:13:32 database.go:1310: closed database I 2024/11/10 12:13:32 conf.go:1021: cleared workspace temp I 2024/11/10 12:13:32 sync.go:727: sync websocket closed I 2024/11/10 12:13:40 working.go:147:


 /  /\        ___           ___        /__/\         /  /\         /__/\
/  /:/_      /  /\         /__/|       \  \:\       /  /::\        \  \:\

/ /:/ /\ / /:/ | |:| \ \:\ / /:/\:\ \ \:\ / /:/ /::\ //::\ | |:| \ \:\ / /:/~/::\ _\:\ //:/ /:/\:\ \\/\:_ ||:| //\ \\:\ //:/ /:/\:\ //::::::::\ \ \:\/:/~/:/ \ \:\/\ //::::\ \ \:\ / /:/ \ \:\/:/\/ \ \:\\\/ \ \::/ /:/ _\::/ ~\\:\ \ \:\ /:/ \ \::/ \ \:\ ~ _\/ /:/ //:/ \ \:\ \ \:\/:/ \ \:\ \ \:\ //:/ _\/ _\/ \ \::/ \ \:\ \ \:\ _\/ _\/ _\/ _\/ I 2024/11/10 12:13:40 runtime.go:79: kernel is booting:

I 2024/11/10 12:14:49 index_fix.go:50: start checking index... I 2024/11/10 12:14:49 index_fix.go:71: finish checking index

More information

目前不支持这种图形吗?

wish5115 commented 2 weeks ago

这不是bug,选项写法有问题,data应该放到option的data里,请不要太相信ai

正确写法如下:

{
    "series": {
        "type": "sunburst",
        "data": [
            {
                "name": "Grandpa",
                "children": [
                    {
                        "name": "Uncle Leo",
                        "value": 15,
                        "children": [
                            {
                                "name": "Cousin Jack",
                                "value": 2
                            },
                            {
                                "name": "Cousin Mary",
                                "value": 5,
                                "children": [
                                    {
                                        "name": "Jackson",
                                        "value": 2
                                    }
                                ]
                            },
                            {
                                "name": "Cousin Ben",
                                "value": 4
                            }
                        ]
                    },
                    {
                        "name": "Father",
                        "value": 10,
                        "children": [
                            {
                                "name": "Me",
                                "value": 5
                            },
                            {
                                "name": "Brother Peter",
                                "value": 1
                            }
                        ]
                    }
                ]
            },
            {
                "name": "Nancy",
                "children": [
                    {
                        "name": "Uncle Nike",
                        "children": [
                            {
                                "name": "Cousin Betty",
                                "value": 1
                            },
                            {
                                "name": "Cousin Jenny",
                                "value": 2
                            }
                        ]
                    }
                ]
            }
        ],
        "radius": [
            60,
            "90%"
        ],
        "itemStyle": {
            "borderRadius": 7,
            "borderWidth": 2
        },
        "label": {
            "show": false
        }
    }
}

如果不会用,建议参考帖子:https://ld246.com/article/1721906460386