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

Possibility of having a line have a start and end without having to fill in the ones in between. #26

Closed wiktoriavh closed 2 years ago

wiktoriavh commented 2 years ago

I am creating a burnup and burndown chart, and for that I want to have a line that starts at zero and ends at the scope. At the moment I have to calculate each point manually to write it down. This is what it looks like:

type: line
labels: [Montag, Dienstag, Mittwoch, Donnerstag, Freitag, Samstag, Sonntag]
series:
    - title: Scope
      data: [72,72,72,72,72,72,72]
    - title: Ideal
      data: [0,12,24,36,48,60,72]
    - title: Burnup
      data: [8, 16, 5]
beginAtZero: true
max: 72
fill: true

I checked the README, but didn't see an option for that. This is what it looks like:

image

Example for Burndown:

type: line
labels: [Montag, Dienstag, Mittwoch, Donnerstag, Freitag, Samstag, Sonntag]
series:
    - title: Ideal
      data: [72,60,48,36,24,12,0]
    - title: Burndown
      data: [72]
beginAtZero: true

image

phibr0 commented 2 years ago

You can try this by adding null in between like so:

type: line
labels: [Montag, Dienstag, Mittwoch, Donnerstag, Freitag, Samstag, Sonntag]
series:
    - title: Scope
      data: [72,null,null,null,null,null,72]
    - title: Ideal
      data: [0,12,24,36,48,60,72]
    - title: Burnup
      data: [8, 16, 5]
beginAtZero: true
max: 72
fill: true
spanGaps: true

And then set spanGaps to true!

wiktoriavh commented 2 years ago

That didn't do anything. This is what I wrote

type: line
labels: [Montag, Dienstag, Mittwoch, Donnerstag, Freitag, Samstag, Sonntag]
series:
    - title: Ideal
      data: [72,null,null,null,0,0,0]
    - title: Burndown
      data: [56, 45, 37, 24, 24]
beginAtZero: true
spanGaps: true
fill: true
max: 72

And this is what I got

image

phibr0 commented 2 years ago

Oh, I forgot to mention that you need to update the Plugin. Should work with the newest version!

wiktoriavh commented 2 years ago

Ah, now I got it to work. Sadly it doesn't fill in the nodes between, so I could hover over them, but that's fine. Thanks for that!