How to plot several variables on an axis with Vega-Lite?

核能气质少年 提交于 2019-12-02 04:10:43

You can use layering as described at https://vega.github.io/vega-lite/docs/layer.html.

{
  "data": {"url": "data/seattle-weather.csv"},
  "layer": [
    {
      "mark": "line",
      "encoding": {
        "x": {
          "timeUnit": "month",
          "field": "date",
          "type": "temporal"
        },
        "y": {
          "aggregate": "mean",
          "field": "temp_min",
          "type": "quantitative"
        }
      }
    },
    {
      "mark": "line",
      "encoding": {
        "x": {
          "timeUnit": "month",
          "field": "date",
          "type": "temporal"
        },
        "y": {
          "aggregate": "mean",
          "field": "temp_max",
          "type": "quantitative"
        }
      }
    }
  ]
}

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!