Auto-adjust label width in graph