Orientation - How tooltips behave
With the Chart component in Views, you can create different types of charts.
Line charts, scatter plots, horizontal bar charts, vertical bar charts.
Depending on the orientation of a chart, you commonly expect different tooltip behaviors:
Horizontal Row Hovering:For horizontally-oriented charts, the tooltip shows all data that is in the same horizontal row:
![]() |
Vertical Column Hovering:
For vertically-oriented charts, the tooltip shows all data that is in the same vertical column:
![]() |
2D Hovering:
For charts that don't have an intuitive orientation, such as a scatter plot, you would not expect the tooltip to show data of all points in the same row or column.Instead, the tooltip should show only the data of the point/circle that you are currently hovering with the mouse pointer.
![]() |
How to use it in YAML
Different types of mark
have different default orientations.
For example, bar
, line
, area
all have "vertical"
as a default orientation while marks of type text
and point
have default orientation "none"
.
If all visuals of the chart have marks with orientation "none", then 2D Hovering is used (ie. only if your mouse is close to the data point a tooltip appears with the respective data).
If at least one visual has a mark with orientation "horizontal" then Horizontal Row Hovering is used.
Else if at least one visual has a mark with orientation "vertical" then Vertical Row Hovering is used.
Note
If the defaults don't work for one of your use cases, you can manually control the hover behavior by setting the orientation of marks used in your visuals.
For example, if you want to add a regression line to a scatterplot without losing the 2D Hovering behavior, you can set orientation: none for the line mark as follows.
![]() |