Parameter Types

Edit this page

Reference documentation for common parameter types expected by Vega specification properties.

Parameter Type Reference

Literal Values

# Any or *

Accepts any literal value, including a string, number, boolean, or null.


# Array or Type[]

Accepts array values. For example: [], [1, 2, 3], ["foo", "bar"]. If individual array items must adhere to a specific type, bracket notation – such as Number[] or String[] – is used to indicate the item type.

In most cases, arrays may also have signal references as items. For example: [{"signal": "width"}, {"signal": "height"}].


# Boolean

Accepts boolean values. For example: true, false.


# Color

Accepts a valid CSS color string. For example: #f304d3, #ccc, rgb(253, 12, 134), steelblue.


# Number

Accepts number values. For example: 1, 3.14, 1e5.


# Object

Accepts object literals. For example: {"left":5, "right":30, "top":5, "bottom":50}. The valid object property names and types will vary across parameters; read the individual parameter descriptions for more information.


# String

Accepts string values. For example: "bold", "step-before", "".


# URL

Accepts a valid URL string linking to external site or resource. For example: "data/stocks.csv", "images/logo.png", "https://vega.github.io/".


# DateTime

A DateTime object (in filter transform, scale domain, and axis/legend values) must have at least one of the following properties:

Property Type Description
year Number

Integer value representing the year.

quarter Number

Integer value representing the quarter of the year (from 1-4).

month Number | String

One of: (1) integer value representing the month from 1-12. 1 represents January; (2) case-insensitive month name (e.g., "January"); (3) case-insensitive, 3-character short month name (e.g., "Jan").

date Number

Integer value representing the date from 1-31.

day Number | String

Value representing the day of a week. This can be one of: (1) integer value – 1 represents Monday; (2) case-insensitive day name (e.g., "Monday"); (3) case-insensitive, 3-character short day name (e.g., "Mon").
Warning: A DateTime definition object with day** should not be combined with year, quarter, month, or date.

hours Number

Integer value representing the hour of a day from 0-23.

minutes Number

Integer value representing the minute segment of time from 0-59.

seconds Number

Integer value representing the second segment (0-59) of a time value

milliseconds Number

Integer value representing the millisecond segment of time.

For example {"year": 2006, "month": "jan", "date": 1} represents Jan 1, 2006.