hvega-0.11.0.1: tests/specs/gallery/line/conditionalaxis.vl
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"config": {
"axis": {
"domainColor": "#ddd",
"tickColor": "#ddd"
}
},
"data": {
"url": "https://vega.github.io/vega-lite/data/stocks.csv"
},
"description": "Line chart with conditional axis ticks, labels, and grid.",
"encoding": {
"x": {
"axis": {
"gridDash": {
"condition": {
"test": {
"equal": 1,
"field": "value",
"timeUnit": "month"
},
"value": []
},
"value": [
2,
2
]
},
"labelAlign": "left",
"labelExpr": "[timeFormat(datum.value, '%b'), timeFormat(datum.value, '%m') == '01' ? timeFormat(datum.value, '%Y') : '']",
"labelOffset": 4,
"labelPadding": -24,
"tickCount": 8,
"tickDash": {
"condition": {
"test": {
"equal": 1,
"field": "value",
"timeUnit": "month"
},
"value": []
},
"value": [
2,
2
]
},
"tickSize": 30
},
"field": "date",
"type": "temporal"
},
"y": {
"field": "price",
"type": "quantitative"
}
},
"mark": "line",
"transform": [
{
"filter": "datum.symbol === 'GOOG'"
},
{
"filter": {
"field": "date",
"range": [
2006,
2007
],
"timeUnit": "year"
}
}
],
"width": 400
}