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
592 stars 27 forks source link

YAMLSyntaxError #12

Closed 39mm closed 3 years ago

39mm commented 3 years ago

Copied an example, but I'm getting a following error:

YAMLSyntaxError: A collection cannot be both a mapping and a sequence at line 1, column 5: type: line ^^^^^^^^^

    type: line
    labels: \[Monday,Tuesday,Wednesday,Thursday,Friday\]
    series:
    - title: Title 1
    data: \[1,2,3,4,5\]
    - title: Title 2
    data: \[5,4,3,2,1\]
    - title: Title 3
    data: \[8,2,5,-1,4\]

I'm using Obsidian v0.11.13

I don't have any issue with YAML, not sure if I have up to date Yaml parser or how to check that.

I appreciate any suggestion. Thanks.

phibr0 commented 3 years ago

As stated in the Readme you can't just copy the Examples from the Readme since the Indentation will be off and Obsidian will try to convert HTML to Markdown which causes issues. You can copy and paste the following into Obsidian while holding CTRL + SHIFT + V:

type: line
labels: [Monday,Tuesday,Wednesday,Thursday,Friday]
series:
  - title: Titel1
    data: [1,2,3,4,5]
  - title: Titel2
    data: [5,4,3,2,1]
  - title: Title3
    data: [8,2,5,-1,4]
tension: 0.5
fill: true