protected virtual void ComputeSize() { var longest = XAxis.GetLongestLabel(); AxisLabelPaint.Typeface = XAxis.Typeface; AxisLabelPaint.TextSize = XAxis.TextSize; var labelSize = AxisLabelPaint.Measure(longest); float labelWidth = labelSize.Width; float labelHeight = AxisLabelPaint.MeasureHeight("Q"); var labelRotatedSize = ChartUtil.GetSizeOfRotatedRectangleByDegrees( labelWidth, labelHeight, XAxis.LabelRotationAngle); XAxis.LabelWidth = (int)Math.Round(labelWidth); XAxis.LabelHeight = (int)Math.Round(labelHeight); XAxis.LabelRotatedWidth = (int)MathF.Round(labelRotatedSize.Width); XAxis.LabelRotatedHeight = (int)MathF.Round(labelRotatedSize.Height); }