Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用垂直或水平操作符在Vega中连接多个视图?_Javascript_Vega_Vega Lite - Fatal编程技术网

Javascript 如何使用垂直或水平操作符在Vega中连接多个视图?

Javascript 如何使用垂直或水平操作符在Vega中连接多个视图?,javascript,vega,vega-lite,Javascript,Vega,Vega Lite,我想在Vega中使用垂直或水平操作符concat多视图? 我试图在“vconcat”数组中放入一个规范,但可视化并没有显示。我需要为多视图做什么 我浏览了以下链接 有人能帮忙举个例子吗? 谢谢使用concat { "$schema": "https://vega.github.io/schema/vega-lite/v2.json", "data": {"url": "data/sp500.csv"}, "vconcat": [{ "width": 480, "mark":

我想在Vega中使用垂直或水平操作符concat多视图? 我试图在“vconcat”数组中放入一个规范,但可视化并没有显示。我需要为多视图做什么

我浏览了以下链接

有人能帮忙举个例子吗? 谢谢

使用concat

{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": {"url": "data/sp500.csv"},
"vconcat": [{
    "width": 480,
    "mark": "area",
    "encoding": {
    "x": {
        "field": "date",
        "type": "temporal",
        "scale": {"domain": {"selection": "brush"}},
        "axis": {"title": "", "labelAngle": 0}
    },
    "y": {"field": "price","type": "quantitative"}
    }
}, {
    "width": 480,
    "height": 60,
    "mark": "area",
    "selection": {
    "brush": {"type": "interval", "encodings": ["x"]}
    },
    "encoding": {
    "x": {
        "field": "date",
        "type": "temporal",
        "axis": {"format": "%Y", "labelAngle": 0}
    },
    "y": {
        "field": "price",
        "type": "quantitative",
        "axis": {"tickCount": 3, "grid": false}
    }
    }
}]
}