A data section specifies the sources a Vega visualization uses, including their names, formats, locations, loading methods, and transformations. A specification can contain more than one data source. section 3.1.1
A data entry can provide data in several ways:
- Embed records directly through the values property. section 3.1.1
- Load a CSV file by combining a URL with a CSV format declaration. section 3.1.1
- Retrieve data in other formats or embed it directly in the JSON specification. section 3.1.1
A named inline data source
The name myData lets other specification elements refer to four inline records containing x and y fields. section 3.1.1
Listing 3.2 An example data section
"data": [
{
"name": "myData",
"values": [
{"x": 10, "y": 20},
{"x": 40, "y": 60},
{"x": 70, "y": 40},
{"x": 90, "y": 80},
]
}
],
Inspect the complete JSON example showing the data array, source name, values, and records. section 3.1.1
