Get Tooltip Text From Bar Chart

I recently helped a colleague get the tool tip text from a bar chart so he could display it in another component. I thought I would post what I did in case it could help anyone else in the future. It turned out to be quite simple:

entity = event.source.getEntityForPoint(event.x, event.y)

category = entity.rowKey
series = entity.columnKey
value = entity.dataset.getValue(entity.rowKey, entity.columnKey)

I used this on the mouseClicked and mouseMoved events on the Bar Chart.

like most things, it’s only easy when you know how! :prayer: