// create data frame response
frame := data.NewFrame("count",
data.NewField("time", nil, []time.Time{}),
data.NewField("temp", nil, []int64{}))
// add the time dimension
// add values
frame.AppendRow(query.TimeRange.To.Add(-1*time.Second), 5)
frame.AppendRow(query.TimeRange.To.Add(-2*time.Second), 4)
frame.AppendRow(query.TimeRange.To.Add(-3*time.Second), 7)
frame.AppendRow(query.TimeRange.To.Add(-4*time.Second), 2)
frame.AppendRow(query.TimeRange.To.Add(-5*time.Second), 1)
response.Frames = append(response.Frames, frame)
return response
the above code snippet is giving me error as Metric request error. Any help on this is appreciated
Also,
If my frame has two fields say time and temp, is it required that values field should be sorted? Because in case of random order of data, Grafana frontend is unable to visualize in Graph