Added avoidLegend option to tooltip

This solves the problem of the tooltip covering the legend. This is
especially bad in shared tooltip mode because it makes the legend unable
to edit in a lot of situations.