Javascript 织女星图表JSON规范改变Y的范围

Javascript 织女星图表JSON规范改变Y的范围,javascript,node.js,charts,data-visualization,vega,Javascript,Node.js,Charts,Data Visualization,Vega,我已使用以下Vega(带NodeJS)JSON规范生成了上面的图表: { "$schema": "https://vega.github.io/schema/vega/v5.json", "description": "A basic line chart example.", "width": 300, "height": 300, "paddi

我已使用以下Vega(带NodeJS)JSON规范生成了上面的图表:

{
  "$schema": "https://vega.github.io/schema/vega/v5.json",
  "description": "A basic line chart example.",
  "width": 300,
  "height": 300,
  "padding": 0,
  "signals": [
    {
      "name": "interpolate",
      "value": "linear",
      "bind": {
        "input": "select",
        "options": [
          "basis",
          "cardinal",
          "catmull-rom",
          "linear",
          "monotone",
          "natural",
          "step",
          "step-after",
          "step-before"
        ]
      }
    }
  ],
  "scales": [
    {
      "name": "x",
      "type": "point",
      "range": "width",
      "domain": {
        "data": "table",
        "field": "x"
      }
    },
    {
      "name": "y",
      "type": "linear",
      "range": "height",
      "nice": true,
      "zero": true,
      "domain": {
        "data": "table",
        "field": "y"
      }
    },
    {
      "name": "color",
      "type": "ordinal",
      "range": "category",
      "domain": {
        "data": "table",
        "field": "c"
      }
    }
  ],
  "axes": [
    {
      "orient": "bottom",
      "scale": "x",
      "zindex": 1
    },
    {
      "orient": "left",
      "scale": "y",
      "zindex": 1
    }
  ],
  "marks": [
    {
      "type": "group",
      "from": {
        "data": "table"
      },
      "marks": [
        {
          "type": "line",
          "from": {
            "data": "table"
          },
          "encode": {
            "enter": {
              "x": {
                "scale": "x",
                "field": "x"
              },
              "y": {
                "scale": "y",
                "field": "y"
              },
              "stroke": {
                "scale": "color",
                "field": "c"
              },
              "strokeWidth": {
                "value": 2
              }
            },
            "update": {
              "interpolate": {
                "signal": "interpolate"
              },
              "strokeOpacity": {
                "value": 1
              }
            },
            "hover": {
              "strokeOpacity": {
                "value": 0.5
              }
            }
          }
        }
      ]
    }
  ]
}
我想知道:

  • 确切地说,如何更改等级库,使y比例仅从图形上的最小值(介于10k和11k之间)到图形上的最大值(介于11k和12k之间)。基本上从10k左右开始到12k左右,而不是一直从0开始

  • 删除折线图下方底部的所有空白

  • 理想情况下,我的预期输出应该如下所示:

    我不想硬编码y刻度的范围,因为它应该是动态的,这取决于保存到JSON文件中的数据

    我从来没有做过数据可视化,也从来没有使用过织女星,请原谅我并提前感谢你们