I have a timeline chart with multiple transaction types (CASH
, INV
, CM
etc.). Each transaction type will have different metadata that is relevant, and I’d like to surface that in the tooltips, and thus make them conditional on trx_type
.
I know condition works within a simple tooltip:
"tooltip": {
"condition": {
"test": "(datum['trx_type'] !== 'CASH')",
"field": "trx_type",
"type": "nominal"
},
"value": "N/A"
},
but can’t seem to figure out how to use it within a more complex (multiple fields) setup:
"tooltip": [
{
"field": "trx_unixtime",
"title": "Event Date",
"type": "nominal",
"timeUnit": "yearmonthdate"
},
{
"field": "trx_type",
"title": "Transaction Type"
},
{
"field": "trx_count",
"title": "# Transactions",
"type": "quantitative",
"format": ",.0f"
}
]
Any suggestions on how to approach this?