Class
ChartRenderer

Provides the base implementation for chart rendering functionality, handling drawing operations and text measurement for chart elements.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.ChartView.dll

Syntax:

cs-api-definition
public class ChartRenderer : IChartRenderer

Inheritance: objectChartRenderer

Derived Classes: CartesianRendererFunnelRendererPieRendererPolarRenderer

Implements: IChartRenderer

Constructors

ChartRenderer(ChartArea)

Initializes a new instance of the ChartRenderer class with the specified chart area.

Declaration

cs-api-definition
public ChartRenderer(ChartArea area)

Parameters

area

ChartArea

The chart area that this renderer will be associated with.

Properties

Graphics

Gets the Graphics object from the current rendering surface.

Declaration

cs-api-definition
public Graphics Graphics { get; }

Property Value

Graphics

Surface

Gets or sets the rendering surface used for drawing operations.

Declaration

cs-api-definition
public object Surface { get; }

Property Value

object

Implements IChartRenderer.Surface

Methods

Draw(object)

Draws the chart using the specified rendering context.

Declaration

cs-api-definition
public virtual void Draw(object context)

Parameters

context

object

The graphics context used for rendering operations.

Implements IChartRenderer.Draw(object)

GetDistanceBetweenPoints(PointF, PointF)

Calculates the Euclidean distance between two points.

Declaration

cs-api-definition
public float GetDistanceBetweenPoints(PointF start, PointF end)

Parameters

start

PointF

The starting point.

end

PointF

The ending point.

Returns

float

The distance between the two points as a float value.

HitTest(int, int)

Performs hit testing to find the data point at the specified coordinates.

Declaration

cs-api-definition
public virtual DataPoint HitTest(int x, int y)

Parameters

x

int

The x-coordinate for hit testing.

y

int

The y-coordinate for hit testing.

Returns

DataPoint

The DataPoint at the specified coordinates, or null if no data point is found.

Implements IChartRenderer.HitTest(int, int)

Initialize()

Initializes the renderer by setting up smart labels controller and calculating label positions if available.

Declaration

cs-api-definition
protected virtual void Initialize()

Invalidate(object)

Invalidates the specified model to trigger a redraw operation.

Declaration

cs-api-definition
public virtual void Invalidate(object model)

Parameters

model

object

The model object to invalidate.

Implements IChartRenderer.Invalidate(object)

MeasureRotatedLabels(string, object, double)

Measures the size of rotated text labels considering the rotation angle.

Declaration

cs-api-definition
public virtual RadSize MeasureRotatedLabels(string text, object context, double rotationAngle)

Parameters

text

string

The text to measure.

context

object

The font context used for measurement.

rotationAngle

double

The rotation angle in degrees.

Returns

RadSize

A RadSize representing the measured dimensions of the rotated text.

Implements IChartRenderer.MeasureRotatedLabels(string, object, double)

MeasureText(string, object)

Measures the size of the specified text using the provided font context.

Declaration

cs-api-definition
public virtual RadSize MeasureText(string text, object context)

Parameters

text

string

The text to measure.

context

object

The font context used for measurement.

Returns

RadSize

A RadSize representing the measured dimensions of the text.

Implements IChartRenderer.MeasureText(string, object)

ToPoint(RadPoint)

Converts a RadPoint to a Point with rounded coordinates.

Declaration

cs-api-definition
public static Point ToPoint(RadPoint point)

Parameters

point

RadPoint

The RadPoint to convert.

Returns

Point

A Point with rounded integer coordinates.

ToPointF(RadPoint)

Converts a RadPoint to a PointF.

Declaration

cs-api-definition
public static PointF ToPointF(RadPoint point)

Parameters

point

RadPoint

The RadPoint to convert.

Returns

PointF

A PointF with equivalent coordinates.

ToRectangle(RadRect)

Converts a RadRect to a Rectangle with rounded coordinates.

Declaration

cs-api-definition
public static Rectangle ToRectangle(RadRect rect)

Parameters

rect

RadRect

The RadRect to convert.

Returns

Rectangle

A Rectangle with rounded integer coordinates.

ToRectangleF(RadRect)

Converts a RadRect to a RectangleF.

Declaration

cs-api-definition
public static RectangleF ToRectangleF(RadRect rect)

Parameters

rect

RadRect

The RadRect to convert.

Returns

RectangleF

A RectangleF with equivalent dimensions.

ToSize(RadSize)

Converts a RadSize to a Size with rounded coordinates.

Declaration

cs-api-definition
public static Size ToSize(RadSize size)

Parameters

size

RadSize

The RadSize to convert.

Returns

Size

A Size with rounded integer dimensions.

ToSizeF(RadSize)

Converts a RadSize to a SizeF.

Declaration

cs-api-definition
public static SizeF ToSizeF(RadSize size)

Parameters

size

RadSize

The RadSize to convert.

Returns

SizeF

A SizeF with equivalent dimensions.