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
568 stars 26 forks source link

[Bug]: The modifier spanGaps seems to convert empty cells to the value 0. (chart linked to MD table) #55

Open oktayacikalin opened 2 years ago

oktayacikalin commented 2 years ago

Describe the bug

Using a chart linked to a markdown table, spanGaps seems to convert empty cells to the value 0.

Instead, it should just ignore the empty cell.

Relevant errors (if available)

No response

Steps to reproduce

  1. Create a markdown table with some values and some empty cells.
  2. Add a block link to the table.
  3. Add a chart and link it to the table.
  4. Add the option spanGaps to the chart.
  5. The chart displays empty cells as 0.
  6. Put the word "null" into the empty cells, and spanGaps works as it should - except that nobody would put "null" into empty cells.

Expected Behavior

spanGaps should ignore empty cells and treat them as "null".

Additional context

https://github.com/phibr0/obsidian-charts/issues/46#issuecomment-1072216242

Code

| Datum      | warm m³ | kalt m³ |
| ---------- | ------- | ------- |
| 12.03.2022 | 0       | 0       |
| 13.03.2022 | 5       | 8       |
| 14.03.2022 | 10      | 13      |
| 15.03.2022 |         | 18      |
| 16.03.2022 | 18      | 19      |
| 17.03.2022 | 25      | 21      |
^tabelle1

type: line
id: tabelle1
layout: cols
beginAtZero: false
spanGaps: true
tension: 0.5

Operating system

Linux

Friedolito commented 2 years ago

This happens for me too, but also without using the spanGaps modifier. image image

keerah commented 3 months ago

having the same issue with spanGaps, data sourced from a table