【发布时间】:2017-07-26 12:05:53
【问题描述】:
D3 新手。 如何调整 vega-lite 条形图中条形之间的间距并覆盖默认值? binSpacing 我认为仅适用于直方图。请参阅下面的代码。 我也想调整文本和字体系列的颜色...但是在文档中找不到它。
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"width": 1200,
"height": 900,
"data": {
"url": "data/seattle-weather.csv"
},
"mark": "bar",
"encoding": {
"x": {
"aggregate": "count",
"type": "quantitative"
},
"size": {
"value": 40
},
"y": {
"field": "date",
"type": "temporal",
"timeUnit": "month",
"axis": {
"title": "Regions"
}
},
"color": {
"field": "weather",
"type": "nominal",
"scale": {
"domain": [
"0-20 days",
"21-27 days",
">28 days"
],
"range": [
"red",
"orange",
"green"
]
},
"legend": {
"title": "Case Ageing"
}
}
}
}
【问题讨论】:
标签: d3.js bar-chart vega vega-lite