New to Telerik UI for WinFormsStart a free 30-day trial

A SmartLabelsStrategyBase that adjusts the labels vertically.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.ChartView.dll

Syntax:

C#
public class VerticalAdjusmentLabelsStrategy : SmartLabelsStrategyBase

Inheritance: objectSmartLabelsStrategyBaseVerticalAdjusmentLabelsStrategy

Inherited Members SmartLabelsStrategyBase.DistanceToLabel

Constructors

C#
public VerticalAdjusmentLabelsStrategy()

Properties

Gets or sets the distance between labels.

C#
public int DistanceBetweenLabels { get; set; }
Property Value:

The distance between labels.

Methods

Within this method labels' positions are calculated and are set to the SmartLocation property of each label.

C#
public override void CalculateLocations(ChartSeriesCollection series, Rectangle plotArea)
Parameters:seriesChartSeriesCollection

All the series in the current chart view.

plotAreaRectangle

The plot area.

Overrides: SmartLabelsStrategyBase.CalculateLocations(ChartSeriesCollection, Rectangle)

Optimizes label positions after all labels have been processed.

C#
protected virtual void FinalPositionsOptimization(List<LabelElement> labels)
Parameters:labelsList<LabelElement>

The labels.

Gets the best position in downward direction.

C#
protected virtual Rectangle GetBestPositionInDownwardDirection(List<LabelElement> labels, LabelElement labelToMove, CartesianSeries series)
Parameters:labelsList<LabelElement>

The labels.

labelToMoveLabelElement

The label to move.

seriesCartesianSeries

The series.

Returns:

Rectangle

Gets the best position in left direction.

C#
protected virtual Rectangle GetBestPositionInLeftDirection(List<LabelElement> labels, LabelElement labelToMove, CartesianSeries series)
Parameters:labelsList<LabelElement>

The labels.

labelToMoveLabelElement

The label to move.

seriesCartesianSeries

The series.

Returns:

Rectangle

Gets the best position in right direction.

C#
protected virtual Rectangle GetBestPositionInRightDirection(List<LabelElement> labels, LabelElement labelToMove, CartesianSeries series)
Parameters:labelsList<LabelElement>

The labels.

labelToMoveLabelElement

The label to move.

seriesCartesianSeries

The series.

Returns:

Rectangle

Gets the best position in upward direction.

C#
protected virtual Rectangle GetBestPositionInUpwardDirection(List<LabelElement> labels, LabelElement labelToMove, CartesianSeries series)
Parameters:labelsList<LabelElement>

The labels.

labelToMoveLabelElement

The label to move.

seriesCartesianSeries

The series.

Returns:

Rectangle

Gets the element with most overlaps.

C#
protected virtual LabelElement GetElementWithMostOverlaps(List<LabelElement> labels, ChartSeriesCollection series)
Parameters:labelsList<LabelElement>

The labels.

seriesChartSeriesCollection

The series.

Returns:

LabelElement

Determines whether the specified label rectangle has collisions with the rest of the labels.

C#
protected virtual bool HasCollisions(List<LabelElement> labels, LabelElement labelToMove, Rectangle currentRect)
Parameters:labelsList<LabelElement>

The labels.

labelToMoveLabelElement

The label to move.

currentRectRectangle

The current rect for the label being moved.

Returns:

bool

true if the specified rect has collisions; otherwise, false.

Returns a value indicating whether two lines intersect.

C#
protected virtual bool LineIntersectsLine(Point l1p1, Point l1p2, Point l2p1, Point l2p2)
Parameters:l1p1Point

The begin point of the first line.

l1p2Point

The end point of the first line

l2p1Point

The begin point of the second line.

l2p2Point

The end point of the second line.

Returns:

bool

Returns a value indicating whether a line represented with two points intersects the given rectangle.

C#
protected virtual bool LineIntersectsRect(Point p1, Point p2, Rectangle r)
Parameters:p1Point

The begin point of the line.

p2Point

The end point of the line.

rRectangle

The rectangle.

Returns:

bool

Restricts rectangles within the chart axes.

C#
protected virtual void RestrictWithinAxes(List<LabelElement> labels, CartesianSeries series)
Parameters:labelsList<LabelElement>

The labels.

seriesCartesianSeries

The series.

Returns a value indicating whether the series line intersects with the given line.

C#
protected virtual bool SeriesLineIntersectsLine(ChartSeries chartSeries, Point p1, Point p2)
Parameters:chartSeriesChartSeries

The chart series.

p1Point

The begin point of the line.

p2Point

The end point of the line.

Returns:

bool

Returns a value indicating whether the series line intersects with the rectangle.

C#
protected virtual bool SeriesLineIntersectsRect(ChartSeries chartSeries, Rectangle rect)
Parameters:chartSeriesChartSeries

The chart series.

rectRectangle

The rect.

Returns:

bool