A SmartLabelsStrategyBase that adjusts the labels vertically.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.ChartView.dll
Syntax:
public class VerticalAdjusmentLabelsStrategy : SmartLabelsStrategyBase
Inheritance: objectSmartLabelsStrategyBaseVerticalAdjusmentLabelsStrategy
Inherited Members
Constructors
public VerticalAdjusmentLabelsStrategy()
Properties
Gets or sets the distance between labels.
public int DistanceBetweenLabels { get; set; }
The distance between labels.
Methods
Within this method labels' positions are calculated and are set to the SmartLocation property of each label.
public override void CalculateLocations(ChartSeriesCollection series, Rectangle plotArea)
All the series in the current chart view.
plotAreaRectangleThe plot area.
Overrides:
Optimizes label positions after all labels have been processed.
protected virtual void FinalPositionsOptimization(List<LabelElement> labels)
The labels.
Gets the best position in downward direction.
protected virtual Rectangle GetBestPositionInDownwardDirection(List<LabelElement> labels, LabelElement labelToMove, CartesianSeries series)
The labels.
labelToMoveLabelElementThe label to move.
seriesCartesianSeriesThe series.
Returns:Gets the best position in left direction.
protected virtual Rectangle GetBestPositionInLeftDirection(List<LabelElement> labels, LabelElement labelToMove, CartesianSeries series)
The labels.
labelToMoveLabelElementThe label to move.
seriesCartesianSeriesThe series.
Returns:Gets the best position in right direction.
protected virtual Rectangle GetBestPositionInRightDirection(List<LabelElement> labels, LabelElement labelToMove, CartesianSeries series)
The labels.
labelToMoveLabelElementThe label to move.
seriesCartesianSeriesThe series.
Returns:Gets the best position in upward direction.
protected virtual Rectangle GetBestPositionInUpwardDirection(List<LabelElement> labels, LabelElement labelToMove, CartesianSeries series)
The labels.
labelToMoveLabelElementThe label to move.
seriesCartesianSeriesThe series.
Returns:Gets the element with most overlaps.
protected virtual LabelElement GetElementWithMostOverlaps(List<LabelElement> labels, ChartSeriesCollection series)
The labels.
seriesChartSeriesCollectionThe series.
Returns:Determines whether the specified label rectangle has collisions with the rest of the labels.
protected virtual bool HasCollisions(List<LabelElement> labels, LabelElement labelToMove, Rectangle currentRect)
The labels.
labelToMoveLabelElementThe label to move.
currentRectRectangleThe current rect for the label being moved.
Returns:true if the specified rect has collisions; otherwise, false.
Returns a value indicating whether two lines intersect.
Restricts rectangles within the chart axes.
protected virtual void RestrictWithinAxes(List<LabelElement> labels, CartesianSeries series)
The labels.
seriesCartesianSeriesThe series.
Returns a value indicating whether the series line intersects with the given line.
protected virtual bool SeriesLineIntersectsLine(ChartSeries chartSeries, Point p1, Point p2)
The chart series.
p1PointThe begin point of the line.
p2PointThe end point of the line.
Returns:Returns a value indicating whether the series line intersects with the rectangle.
protected virtual bool SeriesLineIntersectsRect(ChartSeries chartSeries, Rectangle rect)
The chart series.
rectRectangleThe rect.
Returns: