View Title
Edit this pageThe title
property of a view specification in Vega-lite adds a descriptive title to a chart. The title property can be either a string or an object defining the title parameters.
For example, the following bar chart is titled “A Simple Bar Chart”.
Title Parameter Object
A title
parameter object can contain the following properties:
Property | Type | Description |
---|---|---|
text | String |
Required. The title text. |
anchor | TitleAnchor |
The anchor position for placing the title. One of Default value: Note: For now, |
angle | Number |
Angle in degrees of title text. |
baseline | String |
Vertical text baseline for title text. One of |
color | Color |
Text color for title text. |
font | String |
Font name for title text. |
fontSize | Number |
Font size in pixels for title text. Default value: |
fontStyle | FontStyle |
Font style for title text. |
fontWeight | String | Number |
Font weight for title text.
This can be either a string (e.g |
frame | String |
The reference frame for the anchor position, one of |
limit | Number |
The maximum allowed length in pixels of legend labels. |
offset | Number |
The orthogonal offset in pixels by which to displace the title from its position along the edge of the chart. |
orient | String |
Default title orientation ( |
style | String | String[] |
A mark style property to apply to the title text mark. Default value: |
zindex | Number |
The integer z-index indicating the layering of the title group relative to other axis, mark and legend groups. Default value: |
For example, we can customize the anchor
of the title of a bar chart.
// Top-level View Specification
{
...
"config": {
"title": : {
...
}
}
}
Title Config
To provide themes for all titles, the title configuration (config: {title: {...}}
) supports all title parameters.