Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit pannel error: TypeError: Cannot read property 'length' of null #204

Open
ruanben opened this issue Apr 1, 2022 · 1 comment
Open

Comments

@ruanben
Copy link

ruanben commented Apr 1, 2022

grafana version: 8.4.1
I create a dashboard and an empty timeseries pannel:

`board := sdk.NewBoard(d.DashName)
board.Time.From = "now-15m"
board.Time.To = "now"

panel := sdk.NewTimeseries("empty panel")
panel.Editable = true

board.Panels = append(board.Panels, panel)
dashRes, err := c.SetDashboard(ctx,*board, sdk.SetDashboardParams{
Overwrite: false,
})`

after i create it , I can see it in grafana, but when i edit the pannel, failed:
image

@mhodovaniuk
Copy link

mhodovaniuk commented Apr 22, 2022

I had a similar issue. It was missing TimeseriesOptions. Fixed it by adding some values, for example:

panel.TimeseriesPanel.Options = sdk.TimeseriesOptions{
	Legend:  sdk.TimeseriesLegendOptions{Calcs: []string{}, DisplayMode: "list", Placement: "bottom"},
	Tooltip: sdk.TimeseriesTooltipOptions{Mode: "single"},
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants