Improves hover detail placement when space is tight

The layout error for hover detail elements is now checked for both left and right alignment.  Then the alignment with the least error is used.

Sorry for the churn on this, after dismissing narrow charts in the last pull request, I immediately ran into a need to handle them more correctly.