Class ChartRenderer
Provides the base implementation for chart rendering functionality, handling drawing operations and text measurement for chart elements.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.ChartView.dll
Syntax
public class ChartRenderer : IChartRenderer
Constructors
ChartRenderer(ChartArea)
Initializes a new instance of the ChartRenderer class with the specified chart area.
Declaration
public ChartRenderer(ChartArea area)
Parameters
ChartArea
area
The chart area that this renderer will be associated with. |
Properties
Graphics
Gets the System.Drawing.Graphics object from the current rendering surface.
Declaration
public Graphics Graphics { get; }
Property Value
System.Drawing.Graphics
|
Surface
Gets or sets the rendering surface used for drawing operations.
Declaration
public object Surface { get; }
Property Value
System.Object
|
Implements
Methods
Draw(Object)
Draws the chart using the specified rendering context.
Declaration
public virtual void Draw(object context)
Parameters
System.Object
context
The graphics context used for rendering operations. |
Implements
GetDistanceBetweenPoints(PointF, PointF)
Calculates the Euclidean distance between two points.
Declaration
public float GetDistanceBetweenPoints(PointF start, PointF end)
Parameters
System.Drawing.PointF
start
The starting point. |
System.Drawing.PointF
end
The ending point. |
Returns
System.Single
The distance between the two points as a float value. |
HitTest(Int32, Int32)
Performs hit testing to find the data point at the specified coordinates.
Declaration
public virtual DataPoint HitTest(int x, int y)
Parameters
System.Int32
x
The x-coordinate for hit testing. |
System.Int32
y
The y-coordinate for hit testing. |
Returns
DataPoint
The DataPoint at the specified coordinates, or null if no data point is found. |
Implements
Initialize()
Initializes the renderer by setting up smart labels controller and calculating label positions if available.
Declaration
protected virtual void Initialize()
Invalidate(Object)
Invalidates the specified model to trigger a redraw operation.
Declaration
public virtual void Invalidate(object model)
Parameters
System.Object
model
The model object to invalidate. |
Implements
MeasureRotatedLabels(String, Object, Double)
Measures the size of rotated text labels considering the rotation angle.
Declaration
public virtual RadSize MeasureRotatedLabels(string text, object context, double rotationAngle)
Parameters
System.String
text
The text to measure. |
System.Object
context
The font context used for measurement. |
System.Double
rotationAngle
The rotation angle in degrees. |
Returns
RadSize
A RadSize representing the measured dimensions of the rotated text. |
Implements
MeasureText(String, Object)
Measures the size of the specified text using the provided font context.
Declaration
public virtual RadSize MeasureText(string text, object context)
Parameters
System.String
text
The text to measure. |
System.Object
context
The font context used for measurement. |
Returns
RadSize
A RadSize representing the measured dimensions of the text. |
Implements
ToPoint(RadPoint)
Converts a RadPoint to a System.Drawing.Point with rounded coordinates.
Declaration
public static Point ToPoint(RadPoint point)
Parameters
RadPoint
point
The RadPoint to convert. |
Returns
System.Drawing.Point
A System.Drawing.Point with rounded integer coordinates. |
ToPointF(RadPoint)
Converts a RadPoint to a System.Drawing.PointF.
Declaration
public static PointF ToPointF(RadPoint point)
Parameters
RadPoint
point
The RadPoint to convert. |
Returns
System.Drawing.PointF
A System.Drawing.PointF with equivalent coordinates. |
ToRectangle(RadRect)
Converts a RadRect to a System.Drawing.Rectangle with rounded coordinates.
Declaration
public static Rectangle ToRectangle(RadRect rect)
Parameters
RadRect
rect
The RadRect to convert. |
Returns
System.Drawing.Rectangle
A System.Drawing.Rectangle with rounded integer coordinates. |
ToRectangleF(RadRect)
Converts a RadRect to a System.Drawing.RectangleF.
Declaration
public static RectangleF ToRectangleF(RadRect rect)
Parameters
RadRect
rect
The RadRect to convert. |
Returns
System.Drawing.RectangleF
A System.Drawing.RectangleF with equivalent dimensions. |
ToSize(RadSize)
Converts a RadSize to a System.Drawing.Size with rounded coordinates.
Declaration
public static Size ToSize(RadSize size)
Parameters
RadSize
size
The RadSize to convert. |
Returns
System.Drawing.Size
A System.Drawing.Size with rounded integer dimensions. |
ToSizeF(RadSize)
Converts a RadSize to a System.Drawing.SizeF.
Declaration
public static SizeF ToSizeF(RadSize size)
Parameters
RadSize
size
The RadSize to convert. |
Returns
System.Drawing.SizeF
A System.Drawing.SizeF with equivalent dimensions. |