Grafana 单击 table 行并在图表栏中显示数据
Grafana click table row and appear data in graph bar
好的,我希望能够单击下面显示的 table 中的行。然后在上面的条形图中显示数据。
因此,通过单击包含 'AREA2' 的行,它实际上会将 'AREA1' 更改为 'AREA2'。那么如何使行可单击并能够使更改在条形图中表示? (假设有超过100个区域)我尝试做的选项叫什么?
条形图查询:
select coalesce(group_name) as group_name,
sum(sales) filter (where device_type = 'HEAD_PHONES') as HEAD_PHONES,
sum(sales) filter (where device_type = 'GUITAR') as guitar,
sum(sales) filter (where device_type = 'XBOX') as xbox,
sum(sales) filter (where device_type is null ) as other
from test
where area = 'AREA1' <-- change to update every row click
group by coalesce(group_name);
整个Table:
我能够使用表中可用的 URL_links 来完成此操作。
Add 创建了一个查询变量,为我的仪表板复制了 url,并在我的 URL 中分配了作为参数传递的调用值。
资源:https://grafana.com/docs/grafana/latest/linking/data-link-variables/
好的,我希望能够单击下面显示的 table 中的行。然后在上面的条形图中显示数据。
因此,通过单击包含 'AREA2' 的行,它实际上会将 'AREA1' 更改为 'AREA2'。那么如何使行可单击并能够使更改在条形图中表示? (假设有超过100个区域)我尝试做的选项叫什么?
条形图查询:
select coalesce(group_name) as group_name,
sum(sales) filter (where device_type = 'HEAD_PHONES') as HEAD_PHONES,
sum(sales) filter (where device_type = 'GUITAR') as guitar,
sum(sales) filter (where device_type = 'XBOX') as xbox,
sum(sales) filter (where device_type is null ) as other
from test
where area = 'AREA1' <-- change to update every row click
group by coalesce(group_name);
整个Table:
我能够使用表中可用的 URL_links 来完成此操作。
Add 创建了一个查询变量,为我的仪表板复制了 url,并在我的 URL 中分配了作为参数传递的调用值。 资源:https://grafana.com/docs/grafana/latest/linking/data-link-variables/