I have multiple pie charts, each showing data from a different cluster.
I would like to define one generic datasource that gets the cluster name as an input. Is there a possibility to define/set variables within a visualization block and pass it to a datasource?
{
"visualizations": {
"viz_pie_chart_cluster1": {
"type": "viz.pie",
"dataSources": {
"primary": "ds1"
},
"title": "Cluster 1",
"options": {
"chart.showPercent": true,
}
# I want to pass the cluster_name=cluster1 from this vizualization
},
"viz_pie_chart_cluster2": {
"type": "viz.pie",
"dataSources": {
"primary": "ds1"
},
"title": "Cluster 2",
"options": {
"chart.showPercent": true,
}
# I want to pass the cluster_name=cluster2 from this vizualization
}
},
"dataSources": {
"ds1": {
"type": "ds.search",
"options": {
"query": "... cluster_name=$cluster_name$ ..."
},
"name": "ds1"
}
}
}