Bug fix when there is no data to plot