我目前正在尝试将grouped bar chart示例应用于某些数据。经过转换的数据是
"data": [
{
"name":"carnet",
"values": [
{
"key" : "lit",
"doc_count" : 10,
"mat_par_eleve" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : "jean",
"doc_count" : 6,
"moyenne_eleve_matiere" : {
"value" : 10.5
}
},
{
"key" : "toto",
"doc_count" : 3,
"moyenne_eleve_matiere" : {
"value" : 14.333333333333334
}
},
{
"key" : "tata",
"doc_count" : 1,
"moyenne_eleve_matiere" : {
"value" : 6.0
}
}
]
}
},
{
"key" : "maths",
"doc_count" : 10,
"mat_par_eleve" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : "tata",
"doc_count" : 7,
"moyenne_eleve_matiere" : {
"value" : 10.142857142857142
}
},
{
"key" : "toto",
"doc_count" : 2,
"moyenne_eleve_matiere" : {
"value" : 14.5
}
},
{
"key" : "jean",
"doc_count" : 1,
"moyenne_eleve_matiere" : {
"value" : 10.0
}
}
]
}
},
{
"key" : "phy",
"doc_count" : 5,
"mat_par_eleve" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : "toto",
"doc_count" : 5,
"moyenne_eleve_matiere" : {
"value" : 11.6
}
}
]
}
}
],
"transform": [
{ "type": "project", "fields":["key", "doc_count", "mat_par_eleve"]},
{"type": "flatten", "fields":["mat_par_eleve.buckets"], "as": ["mat_elev"]},
{ "type": "project", "fields":["key", "doc_count", "mat_elev.key", "mat_elev.doc_count", "mat_elev.moyenne_eleve_matiere"],
"as":["key", "doc_count", "mat_elev_key", "mat_elev_doc_count", "moy_elev_mat"]},
{ "type": "project", "fields":["key", "doc_count", "mat_elev_key", "mat_elev_doc_count", "moy_elev_mat.value"]}
]
}
],
到目前为止,我尝试了以下操作:
这是问题所在:对我来说,我上面给出的两个示例极为相似,我无法找到第一个为什么不显示我的数据,而第二个却正确地显示数据的原因。
有人可以帮我发现差异吗?