phibr0 / obsidian-charts

Charts - Obsidian Plugin | Create editable, interactive and animated Charts in Obsidian via Chart.js
https://charts.phib.ro/
GNU Affero General Public License v3.0
546 stars 25 forks source link

[Bug]: Invalid id and/or file #94

Open tolga-balci opened 9 months ago

tolga-balci commented 9 months ago

Describe the bug

Tagging a table does not render the chart, instead returns the following error:

Couldn't render Chart: Invalid id and/or file You might also want to look for further Errors in the Console: Press CTRL + SHIFT + I to open it.

Relevant errors (if available)

loading table-extended
plugin:obsidian-charts:79 loading plugin: Obsidian Charts
app.js:1 Uncaught (in promise) YAMLParseError: Missing closing "quote at line 13, column 17:

bestFitNumber: 0
                ^

    at onError (app.js:1:961637)
    at l (app.js:1:956641)
    at app.js:1:957809
    at aE (app.js:1:957855)
    at hE (app.js:1:958939)
    at gE (app.js:1:960730)
    at app.js:1:953135
    at rE (app.js:1:953490)
    at gE (app.js:1:960806)
    at app.js:1:949984
    at rE (app.js:1:950235)
    at gE (app.js:1:960806)
    at app.js:1:950691
    at rE (app.js:1:950772)
    at gE (app.js:1:960806)
    at app.js:1:949984
    at rE (app.js:1:950235)
    at gE (app.js:1:960806)
    at app.js:1:962002
    at PE.next [as push] (app.js:1:962144)
    at PE.pop (app.js:1:976331)
    at PE.end (app.js:1:975520)
    at PE.parse (app.js:1:975477)
    at app.js:1:985343
    at OE (app.js:1:985435)
    at tI (app.js:1:1273569)
    at eval (plugin:obsidian-charts:66:4274)
    at l (app.js:1:254362)
    at c (app.js:1:254478)

Steps to reproduce

Use the following table and the chart code in Obsidian:

Customer Number of Tickets
Customer 1 5
Customer 2 2
Customer 3 1
Customer 4 1
Customer 5 5
Customer 6 8
Customer 7 3
Customer 8 3

^WK41

type: bar 
id: ^Wk41
layout: rows 
width: 80% 
beginAtZero: true 

Expected Behavior

Render the chart from the table using the ID.

Note that replacing the caret symbol from the block id also results in the same behavior:

type: bar 
id: Wk41   <--- ^removed from id
layout: rows 
width: 80% 
beginAtZero: true 

Additional context

Table in raw markdown:

image

Chart code, also showing the block id of the table:

image

Error message, immediately after clicking outside the chart block:

image

Code

chart 
type: bar 
id: ^Wk41
layout: rows 
width: 80% 
beginAtZero: true 


### Operating system

Windows