Comments (6)
I faced the same issue, and found a solution after poking around in the code:
The function executed when you click gets 3 arguments, as you can see here:
var f = new Function('data', 'getLocationSrv', 'getTemplateSrv', this.props.options.onclick);
f(data, getLocationSrv, getTemplateSrv);
data
, getLocationSrv
and getTemplateSrv
.
And from the Grafana Docs, you can find how to update a variable from the LocationSrv
.
So TL;DR, simply use:
getLocationSrv().update({
query: {
'var-service': 'billing',
},
partial: true,
replace: true,
});
from ae3e-plotly-panel.
Apologies. User error. I had inadvertently pinned the time range of a panel. The standard from
and to
work as expected with this workaround. Thanks again!
from ae3e-plotly-panel.
This is a good workaround for user-defined variables but seemingly cannot be used to control the timerange of the main window by updating 'from' and 'to' in the query map, as was possible in Grafana < 8.0 with the windowUpdateVariables option. Does anyone have a solution for updating these?
from ae3e-plotly-panel.
Hum.. Not even with the __from
and __to
notations? (with the underscores)
from ae3e-plotly-panel.
Hello,
Trying to get a minimal example to work but having a hard time ...
I'm using Grafana 8.4.6 & Plotly panel 0.5.0.
Using the example provided here as a starting point, I'm trying to get the click script to update the 'project' dashboard variable. With the click script that comes with this example panel, the console reports the same error as @KengHzou was seeing. Changing it to (as suggested by @z0rzi)
getLocationSrv().update({
query: {
'var-service': 'billing',
},
partial: true,
replace: true,
});
results in another error (Uncaught ReferenceError: getLocationSrv is not defined
).
Any help on how this should be modified would be greatly appreciated!
from ae3e-plotly-panel.
So as I understand, the window.updateVariables()
is deprecated? Therefore the default value that is populated in the click data field should be updated?
from ae3e-plotly-panel.
Related Issues (20)
- Autoscale plot to fit the panel HOT 1
- Support for Grafana 8 HOT 4
- installation broken HOT 1
- Changing timerange or refreshing prompts browser for saving changes when closing dashboard HOT 2
- Just a shout out
- Using Grafana graph-hover to modify input data to graph
- Cannot read properties of undefined (reading 'text') - Grafana 8.0+ - Plotly - Elasticsearch HOT 1
- Sunburst on-click marker expansion not working
- shared_xaxes
- Error when using ad-hoc filters
- JS Library Import HOT 2
- Add maintainer HOT 1
- Grafana Version 7.2
- Support for Localization? HOT 2
- Render plot inside custom div
- [Announcement 📣] Updated fork of project - check link inside!
- -- apologies - deleled comment --
- Is possible to do animation map method?
- Timezone selected in the Grafana time picker dropdown UI is not taken into consideration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ae3e-plotly-panel.