How do I prevent the legend and title from overlapping with the chart?