Each widget can display a legend, showing the names (or aliases) and colors of the connected variables. Enable it with Show legend from the context menu of the widget.
The context menu of the legend allows to hide it, to change the text alignment and to edit its stylesheet.