Class
FourPositionsLabelsStrategy

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

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.ChartView.dll

Syntax:

cs-api-definition
public class FourPositionsLabelsStrategy : SmartLabelsStrategyBase

Inheritance: objectSmartLabelsStrategyBaseFourPositionsLabelsStrategy

Derived Classes: EightPositionsLabelsStrategy

Inherited Members SmartLabelsStrategyBase.DistanceToLabel

Constructors

FourPositionsLabelsStrategy()

Declaration

cs-api-definition
public FourPositionsLabelsStrategy()

Properties

PositionsPerLabel

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

Declaration

cs-api-definition
protected virtual int PositionsPerLabel { get; }

Property Value

int

Methods

AssignMinimumOverlapLabels()

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

Declaration

cs-api-definition
protected virtual void AssignMinimumOverlapLabels()

AssignSmartRectangles(ChartSeriesCollection)

Assigns the smart rectangles of labels.

Declaration

cs-api-definition
protected virtual void AssignSmartRectangles(ChartSeriesCollection series)

Parameters

series

ChartSeriesCollection

The series.

BuildAdjacencyMatrix(ChartSeriesCollection)

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

Declaration

cs-api-definition
protected virtual void BuildAdjacencyMatrix(ChartSeriesCollection series)

Parameters

series

ChartSeriesCollection

The series.

CalculateLocations(ChartSeriesCollection, Rectangle)

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

Declaration

cs-api-definition
public override void CalculateLocations(ChartSeriesCollection series, Rectangle plotArea)

Parameters

series

ChartSeriesCollection

All the series in the current chart view.

plotArea

Rectangle

The plot area.

Overrides SmartLabelsStrategyBase.CalculateLocations(ChartSeriesCollection, Rectangle)

GetAllLabelPositions(LabelElement)

Gets all the possible label positions.

Declaration

cs-api-definition
protected virtual IEnumerable<Rectangle> GetAllLabelPositions(LabelElement label)

Parameters

label

LabelElement

The label.

Returns

IEnumerable<Rectangle>

GetLabelLineSide(int)

Gets the label LineSide corresponding to the label position.

Declaration

cs-api-definition
protected virtual LineSide GetLabelLineSide(int labelPosition)

Parameters

labelPosition

int

The label position.

Returns

LineSide

GetLabelRectangle(LabelElement, int)

Gets the label rectangle from its position.

Declaration

cs-api-definition
protected virtual Rectangle GetLabelRectangle(LabelElement label, int labelPosition)

Parameters

label

LabelElement

The label.

labelPosition

int

The label position.

Returns

Rectangle

HasUnassignedLabels()

Determines whether the are labels with unassigned label position.

Declaration

cs-api-definition
protected virtual bool HasUnassignedLabels()

Returns

bool

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

IsFinalSolution()

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

Declaration

cs-api-definition
protected virtual bool IsFinalSolution()

Returns

bool

true if it is final solution; otherwise, false.

IsMatrixEmpty()

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

Declaration

cs-api-definition
protected virtual bool IsMatrixEmpty()

Returns

bool

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

LocalOptimization()

Peforms local optiomizations to labels that improve the global solution.

Declaration

cs-api-definition
protected virtual void LocalOptimization()

MaximumNonconflict()

Places as much as possible labels into positions without overlaps.

Declaration

cs-api-definition
protected virtual void MaximumNonconflict()