Comments (2)
findInLabelMap
is kind of a hook, called for each series. It takes a single argument (a metric object) and returns a string.
I'm not sure about the content of this object. Can you please provide an example in a comment? The doc needs to be improved. ;)
You can use it in this way:
var myChart = new Chart(ctx, {
type: 'line',
plugins: [ChartDatasourcePrometheusPlugin],
options: {
plugins: {
'datasource-prometheus': {
prometheus: {
endpoint: "http://demo.robustperception.io:9090",
baseURL: "/api/v1", // default value
},
query: 'sum by (job) (go_gc_duration_seconds)',
findInLabelMap: (metric) => {
console.log(metric);
return 'hello world';
},
timeRange: {
type: 'relative',
// from 12 hours ago to now
start: -12 * 60 * 60 * 1000,
end: 0,
},
},
},
},
});
from chartjs-plugin-datasource-prometheus.
Added to documentation
from chartjs-plugin-datasource-prometheus.
Related Issues (16)
- Chart.js 3.0 support HOT 3
- How to clear and draw another graph? HOT 4
- Exclude empty label set from caption HOT 4
- baseURL as public parameter HOT 2
- [feature] Histogram chart HOT 3
- Can I use it with vue.js ? HOT 5
- Is there a way to format the time stamps on the x-axis? HOT 1
- Declaration file not found HOT 1
- Please use git tags for versions HOT 2
- Updating chart queries HOT 2
- dataSetHook has an error HOT 1
- Cannot read properties of null (reading 'addEventListener') HOT 4
- Multiple queries on a single chart HOT 1
- Update data in chart without complete redraw HOT 3
- Update Prometheus Query version. HOT 3
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 chartjs-plugin-datasource-prometheus.