Hello. I was able to create a Bubble Chart using Vega, but I need to do the following enhancements;
- Add click bubble to filter
- Add hover legend text to highlight bubble
- Add "kilo" format to X axis (100.000 => 100K) worked with tooltip but not with X axis
I understand that to add click to filter I need to change from vega-lite to vega but couldnt make it work.
This is what I have so far :
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": "Unique name values, ICT(average), Record Count by Tags",
"data": {
"url": {
"%context%": true,
"index": "interactions",
"body": {
"aggs": {
"personal_tag": {
"terms": {"field": "personal_tags", "size": 20},
"aggs": {
"associated_unique": {"cardinality": {"field": "associate_name"}},
"ict": {"avg": {"field": "cycle_time"}}
}
}
},
"size": 0
}
},
"format": {"property": "aggregations.personal_tag.buckets"}
},
"mark": {"type": "circle", "cursor": "pointer", "name": "point"},
"encoding": {
"tooltip": [
{"field": "key", "type": "nominal", "title": "Personal Tags"},
{
"field": "ict.value",
"type": "quantitative",
"title": "ICT (average)",
"format": ".2f"
},
{
"field": "associated_unique.value",
"type": "quantitative",
"title": "Associate Uniq."
},
{"field": "doc_count", "type": "quantitative", "title": "Records"}
],
"x": {
"field": "ict.value",
"type": "quantitative",
"axis": {"title": "ICT(avg)"},
"scale": {"zero": false}
},
"y": {
"field": "associated_unique.value",
"type": "quantitative",
"axis": {"title": "Associate Name (unique values)"}
},
"size": {"field": "doc_count", "type": "quantitative", "legend": false},
"color": {"field": "key", "type": "nominal", "title": "Personal Tags"}
}
}
Thanks