vega-lite icon indicating copy to clipboard operation
vega-lite copied to clipboard

tooltip with content set to data should use x-axis title

Open NeilMacMullen opened this issue 5 months ago • 0 comments

Enhancement Description

When dynamically generating charts from data, it's convenient to be able to use

 "tooltip": {"content": "data"}

This creates a tooltip that contains the distinct values in the Color channel with a first item that is set to the name of the x-axis field. However, it would make more sense (imo) to use the name of the x-axis title.

For example, this spec

  • displays a tooltip like this where the x-axis is being shown as date (the underlying name of the field) rather than Year which is the annotation on the axis... image

If you don't want to break backwards compatibility then it would seem the syntax described in this related issue could be used to provide an additional annotation to turn on this behaviour

Checklist

  • [y] I checked for duplicate issues.

NeilMacMullen avatar Feb 06 '24 18:02 NeilMacMullen