@@ -239,7 +239,25 @@ 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 spacingFactor = GetLabelSpacingFactor ( ) ;
242
+
243
+ double spacingFactor = 1.0 ; //If the Axis is Vertical
244
+
245
+ if ( ! IsVertical )
246
+ {
247
+ // Base factor for horizontal labels
248
+ double factor = 0.6 ;
249
+ // Adjust based on label rotation
250
+ double rotationRadians = Math . Abs ( LabelRotation ) * Math . PI / 180 ;
251
+
252
+ if ( rotationRadians > 0 )
253
+ {
254
+ // Rotated labels can be packed more densely
255
+ factor *= 1.0 + 0.3 * Math . Sin ( rotationRadians ) ;
256
+ }
257
+
258
+ spacingFactor = factor ;
259
+ }
260
+
243
261
double adjustedDesiredIntervalsCount = size * spacingFactor * MaximumLabels ;
244
262
return Math . Max ( adjustedDesiredIntervalsCount / 100 , 1.0 ) ;
245
263
}
@@ -776,25 +794,6 @@ void RaiseActualRangeChangedEvent(DoubleRange visibleRange, Size plotSize)
776
794
}
777
795
}
778
796
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
-
798
797
#endregion
799
798
800
799
#endregion
0 commit comments