Skip to content

Common Mistakes

Avoid these pitfalls when creating DataGlass charts.


YAML Syntax Errors

Tabs Instead of Spaces

Mistake: Using tabs for indentation

YAML requires spaces, not tabs. Use 2 spaces per indentation level.

yaml
# Wrong - uses tabs
data:
	file: sales.csv    # Tab character - will fail!

# Correct - uses spaces
data:
  file: sales.csv      # 2 spaces - works!

Fix: Configure your editor to insert spaces when you press Tab.


Missing Quotes Around Special Characters

Mistake: Unquoted values with colons, brackets, or other special characters

yaml
# Wrong - colon breaks parsing
title: Sales: Q1 2024

# Correct - quoted string
title: "Sales: Q1 2024"

Special characters that need quotes: : { } [ ] , & * # ? | - < > = ! % @


Incorrect Indentation

Mistake: Inconsistent or wrong indentation levels

yaml
# Wrong - data.file should be indented under data
data:
file: sales.csv

# Correct
data:
  file: sales.csv

Data Issues

Field Names Don't Match

Mistake: Using field names that don't exist in your data

yaml
# Your CSV has: month,revenue,region
# But you wrote:
x: Month      # Wrong! Case-sensitive - should be "month"
y: sales      # Wrong! Field is called "revenue"

Fix: Check your CSV headers or JSON keys exactly.


Empty or Invalid Data File

Mistake: File path is wrong or file is empty

yaml
data:
  file: data/sales.csv    # File doesn't exist!

Fix:

  1. Check the file exists in your vault
  2. Path is relative to vault root
  3. File has content (not empty)

JSON Syntax in Inline Data

Mistake: Invalid JSON in the source field

yaml
# Wrong - trailing comma
data:
  source: '[{"a": 1}, {"a": 2},]'

# Wrong - single quotes inside
data:
  source: "[{'a': 1}]"

# Correct
data:
  source: '[{"a": 1}, {"a": 2}]'

Chart Configuration

Wrong Chart Type for Data

Mistake: Using a chart type that doesn't fit your data

Data TypeGood ChartsBad Charts
Categoriesbar, pieline (misleading)
Time seriesline, areapie
Relationshipsscatterbar
Hierarchicaltreemap, sunburstline

Missing Required Fields

Mistake: Forgetting x or y when required

yaml
# Wrong - pie needs x and y
type: pie
data:
  file: data.csv
# Missing x and y!

# Correct
type: pie
data:
  file: data.csv
x: category
y: value

Color Field Doesn't Exist

Mistake: Referencing a color field that's not in your data

yaml
data:
  source: '[{"month": "Jan", "value": 10}]'
color: region    # "region" doesn't exist in the data!

Performance Issues

Too Much Data

Mistake: Rendering thousands of points without optimization

yaml
# Slow - 50,000 rows rendered directly
data:
  file: huge-dataset.csv

Fix: Use transformations to aggregate or sample:

yaml
transformations:
  - type: sampling
    configuration:
      method: lttb
      targetSize: 1000

Large Inline Data

Mistake: Embedding huge JSON in the code block

Fix: Use a file instead:

yaml
data:
  file: data/large-dataset.json

Still Stuck?

  1. Check the YAML syntax
  2. Validate your data format
  3. Try a minimal example first, then add complexity
  4. Open an issue with your config

Released under the MIT License.