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

Represents a Fast Algorithm for Label Placement implementation for the RadChartView labels.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.ChartView.dll

Syntax:

C#
public class FourPositionsLabelsStrategy : SmartLabelsStrategyBase

Inheritance: objectSmartLabelsStrategyBaseFourPositionsLabelsStrategy

Derived Classes: EightPositionsLabelsStrategy

Inherited Members SmartLabelsStrategyBase.DistanceToLabel

Constructors

C#
public FourPositionsLabelsStrategy()

Properties

Gets or sets the number of label positions the strategy will serach in.

C#
protected virtual int PositionsPerLabel { get; }

Methods

Adds any labels that do not have a position set to the position with the least collisions.

C#
protected virtual void AssignMinimumOverlapLabels()

Assigns the smart rectangles of labels.

C#
protected virtual void AssignSmartRectangles(ChartSeriesCollection series)
Parameters:seriesChartSeriesCollection

The series.

Builds the adjacency matrix. A matrix that represents the collision graph of all labels.

C#
protected virtual void BuildAdjacencyMatrix(ChartSeriesCollection series)
Parameters:seriesChartSeriesCollection

The series.

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)

Gets all the possible label positions.

C#
protected virtual IEnumerable<Rectangle> GetAllLabelPositions(LabelElement label)
Parameters:labelLabelElement

The label.

Returns:

IEnumerable<Rectangle>

Gets the label LineSide corresponding to the label position.

C#
protected virtual LineSide GetLabelLineSide(int labelPosition)
Parameters:labelPositionint

The label position.

Returns:

LineSide

Gets the label rectangle from its position.

C#
protected virtual Rectangle GetLabelRectangle(LabelElement label, int labelPosition)
Parameters:labelLabelElement

The label.

labelPositionint

The label position.

Returns:

Rectangle

Determines whether the are labels with unassigned label position.

C#
protected virtual bool HasUnassignedLabels()
Returns:

bool

true if [has unassigned labels]; otherwise, false.

Determines whether the current state of the adjacency matrix is a final solution.

C#
protected virtual bool IsFinalSolution()
Returns:

bool

true if it is final solution; otherwise, false.

Determines whether there are uncheck label positions in the adjacency matrix.

C#
protected virtual bool IsMatrixEmpty()
Returns:

bool

true if [is matrix empty]; otherwise, false.

Peforms local optiomizations to labels that improve the global solution.

C#
protected virtual void LocalOptimization()

Places as much as possible labels into positions without overlaps.

C#
protected virtual void MaximumNonconflict()