File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -239,9 +239,9 @@ public double PointToValue(double x, double y)
239239 protected internal double GetActualDesiredIntervalsCount ( Size availableSize )
240240 {
241241 double size = ! IsVertical ? availableSize . Width : availableSize . Height ;
242- double adjustedDesiredIntervalsCount = size * ( ! IsVertical ? 0.54 : 1.0 ) * MaximumLabels ;
243- var actualDesiredIntervalsCount = Math . Max ( adjustedDesiredIntervalsCount / 100 , 1.0 ) ;
244- return actualDesiredIntervalsCount ;
242+ double spacingFactor = GetLabelSpacingFactor ( ) ;
243+ double adjustedDesiredIntervalsCount = size * spacingFactor * MaximumLabels ;
244+ return Math . Max ( adjustedDesiredIntervalsCount / 100 , 1.0 ) ;
245245 }
246246
247247 /// <summary>
@@ -776,6 +776,25 @@ void RaiseActualRangeChangedEvent(DoubleRange visibleRange, Size plotSize)
776776 }
777777 }
778778
779+ double GetLabelSpacingFactor ( )
780+ {
781+ if ( IsVertical )
782+ return 1.0 ;
783+
784+ // Base factor for horizontal labels - more conservative than 0.54
785+ double factor = 0.6 ;
786+ // Adjust based on label rotation
787+ double rotationRadians = Math . Abs ( LabelRotation ) * Math . PI / 180 ;
788+
789+ if ( rotationRadians > 0 )
790+ {
791+ // Rotated labels can be packed more densely
792+ factor *= 1.0 + 0.3 * Math . Sin ( rotationRadians ) ;
793+ }
794+
795+ return factor ;
796+ }
797+
779798 #endregion
780799
781800 #endregion
You can’t perform that action at this time.
0 commit comments