我指的是preview中可用的代码后面的VEGA图表。 “域”:[0,3]用于x和y轴的设定范围。这里如果我设置[-0.5,3],x轴将从-0.5开始,但是如果我想要有正数,例如0.5,那么x轴将不会从该值开始而是从0开始。有没有其他选择如何解决这个问题?
{
"name": "image",
"width": 200,
"height": 200,
"padding": {"left":30, "top":10, "bottom":30, "right":10},
"data": [
{
"name": "data",
"values": [
{"x":0.5, "y":0.5, "img":"data/ffox.png"},
{"x":1.5, "y":1.5, "img":"data/gimp.png"},
{"x":2.5, "y":2.5, "img":"data/7zip.png"}
]
}
],
"scales": [
{"name": "x", "domain": [0, 3], "range": "width"},
{"name": "y", "domain": [0, 3], "range": "height"}
],
"axes": [
{"type": "x", "scale": "x"},
{"type": "y", "scale": "y"}
],
"marks": [
{
"type": "image",
"from": {"data": "data"},
"properties": {
"enter": {
"url": {"field": "data.img"},
"width": {"value": 50},
"height": {"value": 50},
"x": {"scale": "x", "field": "data.x"},
"y": {"scale": "y", "field": "data.y"},
"align": {"value": "center"},
"baseline": {"value": "middle"}
},
"update": {
"opacity": {"value": 1.0}
},
"hover": {
"opacity": {"value": 0.5}
}
}
}
]
}
答案 0 :(得分:0)
添加属性“零”:比例为假
~/Library/Developer/Xcode/DerivedData