fixed no seriesField in options
This commit is contained in:
parent
1bb10dce50
commit
8bdc07e041
|
@ -298,17 +298,9 @@ func getMetadataByIndexPattern(clusterID, indexPattern, timeField string, filter
|
||||||
var (
|
var (
|
||||||
metas []insight.Visualization
|
metas []insight.Visualization
|
||||||
seriesType string
|
seriesType string
|
||||||
options = map[string]interface{}{
|
|
||||||
"yField": "value",
|
|
||||||
}
|
|
||||||
aggTypes []string
|
aggTypes []string
|
||||||
)
|
)
|
||||||
if timeField != "" {
|
|
||||||
options["xAxis"] = util.MapStr{
|
|
||||||
"type": "time",
|
|
||||||
}
|
|
||||||
options["xField"] = "timestamp"
|
|
||||||
}
|
|
||||||
var fieldNames []string
|
var fieldNames []string
|
||||||
for fieldName := range fieldsMeta.Aggregatable {
|
for fieldName := range fieldsMeta.Aggregatable {
|
||||||
fieldNames = append(fieldNames, fieldName)
|
fieldNames = append(fieldNames, fieldName)
|
||||||
|
@ -325,7 +317,15 @@ func getMetadataByIndexPattern(clusterID, indexPattern, timeField string, filter
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for fieldName, count := range counts {
|
for fieldName, count := range counts {
|
||||||
delete(options, "seriesField")
|
options := map[string]interface{}{
|
||||||
|
"yField": "value",
|
||||||
|
}
|
||||||
|
if timeField != "" {
|
||||||
|
options["xAxis"] = util.MapStr{
|
||||||
|
"type": "time",
|
||||||
|
}
|
||||||
|
options["xField"] = "timestamp"
|
||||||
|
}
|
||||||
if count <= 1 {
|
if count <= 1 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue