vega-lite
vega-lite copied to clipboard
tooltip with content set to data should use x-axis title
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...
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.