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)
239
239
protected internal double GetActualDesiredIntervalsCount ( Size availableSize )
240
240
{
241
241
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 ) ;
245
245
}
246
246
247
247
/// <summary>
@@ -776,6 +776,25 @@ void RaiseActualRangeChangedEvent(DoubleRange visibleRange, Size plotSize)
776
776
}
777
777
}
778
778
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
+
779
798
#endregion
780
799
781
800
#endregion
You can’t perform that action at this time.
0 commit comments