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.
# 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
# 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
# Wrong - data.file should be indented under data
data:
file: sales.csv
# Correct
data:
file: sales.csvData Issues
Field Names Don't Match
Mistake: Using field names that don't exist in your data
# 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
data:
file: data/sales.csv # File doesn't exist!Fix:
- Check the file exists in your vault
- Path is relative to vault root
- File has content (not empty)
JSON Syntax in Inline Data
Mistake: Invalid JSON in the
sourcefield
# 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 Type | Good Charts | Bad Charts |
|---|---|---|
| Categories | bar, pie | line (misleading) |
| Time series | line, area | pie |
| Relationships | scatter | bar |
| Hierarchical | treemap, sunburst | line |
Missing Required Fields
Mistake: Forgetting
xorywhen required
# 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: valueColor Field Doesn't Exist
Mistake: Referencing a color field that's not in your data
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
# Slow - 50,000 rows rendered directly
data:
file: huge-dataset.csvFix: Use transformations to aggregate or sample:
transformations:
- type: sampling
configuration:
method: lttb
targetSize: 1000Large Inline Data
Mistake: Embedding huge JSON in the code block
Fix: Use a file instead:
data:
file: data/large-dataset.jsonStill Stuck?
- Check the YAML syntax
- Validate your data format
- Try a minimal example first, then add complexity
- Open an issue with your config