1

我正在尝试归档这样的东西: 例如,使用 kibana 和/或 Vega/Vega-lite。

我用来将索引添加到 kibana 的 csv 文件是:

student1,90,80,85,95
student2,50,60,55,100
student3,40,70,50,60

目前我有这个:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "data": {
    "url": {
      %context%: true,
      "index":"grades",
      "body":{
          "size":5
          "_source":["StudentName","test1","test2","test3","test4"]
        }
      },
      "format":{"property":"hits.hits"}
  },
  "mark": "line",
  "encoding": {
    "x": {"field": "_source.test1", "type": "quantitative"},
    "y": {"field": "_source.StudentName", "type": "nominal"}
  }
}

所以我的问题是试图归档图片上的内容。我知道我的 Vega 代码的“编码”部分不正确,但我在寻找在 X 轴上具有多个参数的方法时遇到了问题。

我认为: 如果我设法将数据中的硬编码值替换为来自 kibana 索引的数据,那么vega 示例就可以解决问题。有什么方法可以在“值”中使用“_source.fields”,或者我可以使用任何编码选项来归档我的结果?

提前致谢。

注意:我的最终结果很可能只有 1 个学生。但我希望实时更新可视化,因此需要使用该字段。

4

1 回答 1

2

您在这里提出了您的问题,并且已经发布了答案 - https://github.com/vega/vega/issues/1229#issuecomment-379593878

于 2018-04-09T00:15:05.517 回答