Hassan A
Hassan A

Reputation: 337

Adding colours to Vega tooltip keys

I am trying to get to grips with Vega charts. I have created a chart with multiple line series, and I want to style a Vega tooltip so that the colours of it's key/value pairs match the colours of the various series in the graph.

For instance, with this example, I would like the tooltip keys to be consistent with the colour of the keys in the legend.

enter image description here

Any thoughts on how to do this?

Upvotes: 1

Views: 906

Answers (1)

hk7math
hk7math

Reputation: 297

If you are open to using CSS, may try something like this to set the colors

#vg-tooltip-element tr:nth-child(1) td:first-child {
  color: #96abc7
}

Upvotes: 1

Related Questions