上海
区域分布
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "房屋数量按区域分布",
"data": {
"url": "../../assets/data/sh/2024/rental-all-by-district.csv"
},
"width": 300,
"transform": [
{"joinaggregate": [{"op": "median", "field": "mean", "as": "median-line"}]}
],
"mark": {"type": "arc", "innerRadius": 50, "tooltip": true},
"encoding": {
"theta": {"field": "count", "type": "quantitative", "stack": true},
"color": {
"field": "district",
"type": "nominal",
"scale": {"scheme": "tableau20"}
},
"order": {"field": "count", "type": "quantitative", "sort": "descending"}
}
}
租金趋势
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "Stock prices of 5 Tech Companies over Time.",
"vconcat": [
{
"data": {
"url": "../../assets/data/sh/2024/rental-monthly-by-district.csv"
},
"mark": {"type": "line", "point": true, "tooltip": true},
"params": [
{
"name": "district",
"select": {"type": "point", "fields": ["district"]},
"bind": "legend"
}
],
"encoding": {
"x": {
"field": "month",
"type": "quantitative",
"axis": {"tickMinStep": 1}
},
"y": {"field": "mean", "type": "quantitative", "title": "整租租金"},
"color": {
"field": "district",
"type": "nominal",
"scale": {"scheme": "tableau20"}
},
"opacity": {
"condition": {"param": "district", "value": 1},
"value": 0.05
}
}
},
{
"data": {
"url": "../../assets/data/sh/2024/rental-per-area-monthly-by-district.csv"
},
"mark": {"type": "line", "point": true, "tooltip": true},
"params": [
{
"name": "district",
"select": {"type": "point", "fields": ["district"]},
"bind": "legend"
}
],
"encoding": {
"x": {
"field": "month",
"type": "quantitative",
"axis": {"tickMinStep": 1}
},
"y": {"field": "mean", "type": "quantitative", "title": "每平米租金"},
"color": {
"field": "district",
"type": "nominal",
"scale": {"scheme": "tableau20"}
},
"opacity": {
"condition": {"param": "district", "value": 1},
"value": 0.05
}
}
}
],
"config": {"axisY": {"minExtent": 50}}
}
排行榜
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "Stock prices of 5 Tech Companies over Time.",
"hconcat": [
{
"data": {
"url": "../../assets/data/sh/2024/rental-all-by-district.csv"
},
"transform": [
{
"joinaggregate": [
{"op": "median", "field": "mean", "as": "median-line"}
]
}
],
"layer": [
{
"mark": {"type": "bar", "tooltip": true},
"encoding": {
"y": {
"field": "district",
"type": "ordinal",
"sort": "-x",
"title": "区域"
},
"x": {"field": "mean", "type": "quantitative", "title": "整租租金"},
"color": {
"field": "district",
"type": "nominal",
"scale": {"scheme": "tableau20"}
}
}
},
{
"mark": {"type": "rule", "color": "red", "tooltip": true},
"encoding": {
"x": {
"aggregate": "median",
"field": "median-line",
"type": "quantitative"
}
}
}
]
},
{
"data": {
"url": "../../assets/data/sh/2024/rental-per-area-all-by-district.csv"
},
"transform": [
{
"joinaggregate": [
{"op": "median", "field": "mean", "as": "median-line"}
]
}
],
"layer": [
{
"mark": {"type": "bar", "tooltip": true},
"encoding": {
"y": {
"field": "district",
"type": "ordinal",
"sort": "-x",
"title": null
},
"x": {"field": "mean", "type": "quantitative", "title": "每平米租金"},
"color": {
"field": "district",
"type": "nominal",
"scale": {"scheme": "tableau20"}
}
}
},
{
"mark": {"type": "rule", "color": "red", "tooltip": true},
"encoding": {
"x": {
"aggregate": "median",
"field": "median-line",
"type": "quantitative"
}
}
}
]
}
]
}
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "../../assets/data/sh/2024/rental-per-area-all-by-subdistrict.csv"
},
"mark": {"type": "bar", "tooltip": true},
"encoding": {
"y": {"field": "subdistrict", "type": "ordinal", "sort": "-x"},
"x": {"field": "mean", "type": "quantitative", "title": "每平米租金"},
"tooltip": {"field": "mean", "type": "quantitative"}
}
}