Class RadSparklineElement
Represents the main visual element for the RadSparkline control, providing the core rendering and interaction functionality for sparkline charts.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadSparklineElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Constructors
RadSparklineElement()
Declaration
public RadSparklineElement()
Properties
Series
Gets or sets the data series that provides the values to be displayed in the sparkline chart.
Declaration
public SparkSeries Series { get; set; }
Property Value
SparkSeries
|
View
Gets the SparkView instance that controls the rendering and display of the sparkline chart.
Declaration
public SparkView View { get; }
Property Value
SparkView
|
Wrapper
Gets the SparkWrapper instance that manages the underlying sparkline visualization and data processing.
Declaration
public SparkWrapper Wrapper { get; }
Property Value
SparkWrapper
|
Methods
ArrangeOverride(SizeF)
Performs the final arrangement of child elements within the specified bounds and returns the actual size used.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
System.Drawing.SizeF
finalSize
The final area within which this element should arrange itself and its children. |
Returns
System.Drawing.SizeF
The actual size used by the element during arrangement. |
Overrides
CreateChildElements()
Creates the child elements required for the sparkline functionality, including the spark wrapper element.
Declaration
protected override void CreateChildElements()
Overrides
CreateSparkWrapperElement()
Creates and returns a new SparkWrapper element that will manage the sparkline visualization and data handling.
Declaration
protected virtual SparkWrapper CreateSparkWrapperElement()
Returns
SparkWrapper
A new SparkWrapper instance configured for this sparkline element. |
ExportToImage(Stream, Size, ImageFormat)
Exports the sparkline visualization to an image stream in the specified format and size.
Declaration
public void ExportToImage(Stream stream, Size size, ImageFormat imageFormat)
Parameters
System.IO.Stream
stream
The stream where the exported image data will be written. |
System.Drawing.Size
size
The dimensions of the exported image in pixels. |
System.Drawing.Imaging.ImageFormat
imageFormat
The image format to use for the export operation. |
GetStylableChildren()
Gets the direct stylable children elements for theme and style application.
Declaration
protected override IEnumerable<RadObject> GetStylableChildren()
Returns
System.Collections.Generic.IEnumerable<RadObject>
An enumerable collection of direct child RadObject instances that can be styled. |
Overrides
GetStylableChildrenHierarchy()
Gets the hierarchy of stylable children elements, including the view and all child elements for theming and styling purposes.
Declaration
protected override IEnumerable<RadObject> GetStylableChildrenHierarchy()
Returns
System.Collections.Generic.IEnumerable<RadObject>
An enumerable collection of RadObject instances that can be styled. |
Overrides
InitializeFields()
Initializes member fields to their default values, setting up the element to stretch both horizontally and vertically.
Declaration
protected override void InitializeFields()
Overrides
OnKeyDown(KeyEventArgs)
Handles the key down event by forwarding the event to the wrapper element for processing.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
The key event arguments containing the pressed key information. |
Overrides
OnKeyPress(KeyPressEventArgs)
Handles the key press event by forwarding the event to the wrapper element for processing.
Declaration
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
System.Windows.Forms.KeyPressEventArgs
e
The key press event arguments containing the pressed character information. |
Overrides
OnKeyUp(KeyEventArgs)
Handles the key up event by forwarding the event to the wrapper element for processing.
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
The key event arguments containing the released key information. |
Overrides
OnMouseDown(MouseEventArgs)
Handles the mouse down event by converting coordinates to local space and forwarding to the wrapper element.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
The mouse event arguments containing button, position, and click information. |
Overrides
OnMouseEnter(EventArgs)
Handles the mouse enter event by forwarding the event to the wrapper element for processing.
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
System.EventArgs
e
The event arguments for the mouse enter event. |
Overrides
OnMouseHover(EventArgs)
Handles the mouse hover event by forwarding the event to the wrapper element for processing.
Declaration
protected override void OnMouseHover(EventArgs e)
Parameters
System.EventArgs
e
The event arguments for the mouse hover event. |
Overrides
OnMouseLeave(EventArgs)
Handles the mouse leave event by forwarding the event to the wrapper element for processing.
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
System.EventArgs
e
The event arguments for the mouse leave event. |
Overrides
OnMouseMove(MouseEventArgs)
Handles the mouse move event by converting coordinates to local space and forwarding to the wrapper element.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
The mouse event arguments containing position and movement information. |
Overrides
OnMouseUp(MouseEventArgs)
Handles the mouse up event by converting coordinates to local space and forwarding to the wrapper element.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
The mouse event arguments containing button and position information. |
Overrides
OnMouseWheel(MouseEventArgs)
Handles the mouse wheel event by converting coordinates to local space and forwarding to the wrapper element.
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
The mouse event arguments containing wheel delta and position information. |
Overrides
OnRenderSizeChanged(SizeChangedInfo)
Handles render size change events and raises the RenderSizeChanged event to notify subscribers of layout changes.
Declaration
protected override void OnRenderSizeChanged(SizeChangedInfo info)
Parameters
SizeChangedInfo
info
The size change information containing old and new size values. |
Overrides
PaintElement(IGraphics, Single, SizeF)
Renders the sparkline element using the specified graphics context, applying rotation and scaling transformations as needed.
Declaration
protected override void PaintElement(IGraphics graphics, float angle, SizeF scale)
Parameters
IGraphics
graphics
The graphics context used for rendering operations. |
System.Single
angle
The rotation angle to apply during rendering. |
System.Drawing.SizeF
scale
The scaling factor to apply during rendering. |
Overrides
ShouldFallbackToDefaultTheme()
Determines whether the element should fall back to the default theme when no specific theme is applied.
Declaration
protected override bool ShouldFallbackToDefaultTheme()
Returns
System.Boolean
false to indicate that this element uses its own theming system rather than falling back to defaults. |
Overrides
Events
CreatePoint
Occurs when a new data point is created for the sparkline, allowing customization of individual data points.
Declaration
public event SparklineCreatePointEventHandler CreatePoint
Event Type
SparklineCreatePointEventHandler
|
CreateRenderer
Occurs when the sparkline area requires a custom renderer for the first time, allowing users to provide custom rendering implementations.
Declaration
public event SparklineCreateRendererEventHandler CreateRenderer
Event Type
SparklineCreateRendererEventHandler
|
PaintSparkFill
Occurs when a sparkline fill area is about to be painted, providing access to customize the brush used for filling regions.
Declaration
public event PaintSparkFillEventHandler PaintSparkFill
Event Type
PaintSparkFillEventHandler
|
PaintSparkStroke
Occurs when a sparkline stroke is about to be painted, providing access to customize the pen used for drawing lines and borders.
Declaration
public event PaintSparkStrokeEventHandler PaintSparkStroke
Event Type
PaintSparkStrokeEventHandler
|
RenderSizeChanged
Occurs when the render size of the sparkline element changes, providing notification for layout adjustments.
Declaration
public event EventHandler RenderSizeChanged
Event Type
System.EventHandler
|