void SetLabelsSize() { string str = " "; foreach (AxisLabel aL in labelsCollection) { if (aL.Text[0].Length > str.Length) { str = aL.Text[0]; } } SizeF sf = ParentControl.CreateGraphics().MeasureString(str, Font); labelSize = new Size((int)sf.Width, (int)sf.Height); }