I am making a time series line chart, currently using Google's standard Line Chart. The data consists of a set of dates and values for about a dozen different categories. There is no problem plotting this all to a chart.
What I'm running into is that I would like to overlay on the chart different milestones, what I'm looking for is some sort of annotation marker for a given date. The problem is there is no guarantee that the date of one of these milestones would necessarily land on the same date as one of the datapoints, and at least so far Google's Annotation Chart or adding annotations to the Line Chart all seem to require that the annotation be added as an optional text to a preexisting data point.
I started playing with Rickshaw since some of the tutorials made it look like it supported arbitrary annotation points, but it seems like it's a bit of work to get it to look as nice as the Google charts do out of the box.
Is there a way or hack or something to add annotations to the Google Annotation Chart if the annotation date doesn't match to the date of an existing data point? Or is there some other charting library that would more easily handle this?
With the LineCharts, you can annotate the axis values by adding an 'annotation' role column immediate after the domain (axis) column. You can add one or more rows to your DataTable that contain annotations on specific dates, even if those dates don't have any data at other points - just set those other columns to null.
Related
Well, let's say that I have the query from my previous question: How to do multi graph time series on Grafana with Kusto
Then I'd like to consume the tiemposCicloBruto variable from one panel to another in order to avoid repeating queries.
I saw: https://grafana.com/blog/2020/10/14/learn-grafana-share-query-results-between-panels-to-reduce-load-time/
But there isn't any way to share variables at all...
I also tried it as a dashboard variable, but it doesn't seem to support tabular expressions at all...
You can share only input variables across dashboard panels. Variables work as primitive text substitution in one direction (from dashboard to query), and do not take into account any context in your query language.
Your link tells about sharing results of the query between different panels. If exact same result set returned to a panel fits your needs, you can reuse it "for free", without putting load on the database. You don't need to save it into any variable, you just set it as a pseudo-datasource and you get the result immediately.
You can factor this feature into design of you panels. Examples could be:
time series plus histogram visualizations of the same data;
time-series chart plus a panel with latest readings (or use other Grafana reduce expressions).
There is a graph display elasticsearch index count, see below
I want to add a value: diff = max - min in Legend, how to implement it?
I'm pretty sure you can't, easily. You can hack your way around it by adding yet another query to your graph, something like
max_over_time(my_metric[[[__range_s]]s]) - min_over_time(my_metric[[[__range_s]]s])
Grafana will replace the [[__range_s]] bit with the length of the time range of the current dashboard, e.g. 3600 for the default 1h, so the query actually sent to Prometheus will be
max_over_time(my_metric[3600s]) - min_over_time(my_metric[3600s])
Meaning Prometheus will compute the difference between the max and min separately from Grafana (which does it on top of the samples returned by Prometheus). (It will also compute this difference for the whole time range, not just the most recent sample, which is what you're interested in.) Then you can tweak the display of said time series in Grafana (e.g. by setting line=0, fill=0) so it will not show up on the graph itself, only in the legend. But the legend will then display the current value of the difference, as well as its min, max, avg, which will be quite the crappy UX.
Edit: Or you can add said query to a separate panel (e.g. a table panel), to the right of your graph. That may let you better control the UX, although it still won't be part of the actual legend.
Edit 2: One final thing you could try, that would give you exactly what you want, is to tweak Grafana's graph panel to add a "range" value next to "min", "max" and the bunch. The source code is here, I'm pretty sure it's mostly a copy-pasta job. You likely wouldn't even have to rebuild all of Grafana, you could just package the modified panel as "Tweaked Graph Panel" plugin and drop it into your Grafana deployment's plugins folder. Then, in your dashboard, instead of using "Graph Panel", use "Tweaked Graph Panel".
I'm creating the timeseries_stacked_column chart using SAPUI5 and the framework is plotting data for missing weeks even thought it's not fed to the chart. Please can anyone guide what's the best approach to avoid this.
Document link for chart property reference:
https://sapui5.hana.ondemand.com/docs/vizdocs/index.html#reference/chartProperty/Charts/Bar%20%20(15)/Stacked%20Column%20Chart%20for%20Date/Time%20Series/
Please see the screenshot below for the issue
Unfortunately the time series doesn't skip the intervals so the alternate solution to this was to use stacked_column chart with array of dimensions ["Year", "Week"] and plot accordingly.
Example: https://jsbin.com/nejefizuve/edit?html,output
I have a BarChart and Table on the same data.
I want to link these two visualizations such that if I sort the table column by a mouse click on one of the columns, it would reflect in the bar chart.
I found one example for the Visualization api:
http://code.google.com/apis/chart/interactive/docs/examples.html
But the sort method is not avaiable for com.google.gwt.visualization.client.DataTable.
How can I do it?
The google-gwt-apis haven't been updated for a long time and don't support the latest gogole chart features.
However you can extend DataTable and use JSNI to implement the sorting and unsupported functions yourself.
Refer to the DataTable.java and the google chart tools for more information.
Is there any way to add more series of data to be shown in range selector below actual chart. Now it is only one although i have two series of data in chart.
Nope, currently not. I am dealing with the same issue. The range selector is always showing the first graph added to the chart.