Skip to content

Commit 4873006

Browse files
authored
Update README.md
1 parent 6bf2c4c commit 4873006

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,22 @@ var myChart = new Chart(ctx, {
238238
});
239239
```
240240

241+
### Update
242+
243+
Query update:
244+
245+
```js
246+
chart.options.plugins['datasource-prometheus'].query = "new query";
247+
chart.update({});
248+
```
249+
250+
Start/end range update:
251+
252+
```js
253+
chart.options.plugins['datasource-prometheus'].timeRange.start = startTime;
254+
chart.update({});
255+
```
256+
241257
### Custom queries
242258

243259
In the context of a multitenant application, it is not a good idea to write a query on the browser side. In that scenario, you may need to send a custom request to your backend, which is responsible for doing the final Prometheus query.

0 commit comments

Comments
 (0)