ClassChartView
Represents the core chart view element that manages chart areas, series, data binding, and visualization rendering within a chart control.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.ChartView.dll
Syntax:
public class ChartView : UIChartElement, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IStylableElement, IStylableNode, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IShapedElement, IChartView, IChartElementPresenter
Inheritance: objectDisposableObjectRadObjectUIChartElementChartView
Implements:
Inherited Members
Constructors
ChartView(IChartViewHost)
Initializes a new instance of the ChartView class with the specified chart view host and creates a default Cartesian area.
Declaration
public ChartView(IChartViewHost owner)
Parameters
owner
The IChartViewHost that will host this chart view.
ChartView(RadChartElement)
Initializes a new instance of the ChartView class using the wrapper from the specified RadChartElement.
Declaration
public ChartView(RadChartElement owner)
Parameters
owner
The RadChartElement that will own this chart view.
ChartView(RadChartView)
Initializes a new instance of the ChartView class using the chart element wrapper from the specified RadChartView control.
Declaration
public ChartView(RadChartView owner)
Parameters
owner
The RadChartView control that will own this chart view.
Fields
MarginProperty
Identifies the Margin dependency property that defines the spacing between the chart view and its container.
MinSizeProperty
Identifies the MinSize dependency property that defines the minimum size constraints for the chart view.
Properties
Annotations
Gets the collection of chart annotations that provide additional visual elements overlaid on the chart.
Declaration
public ChartAnnotationCollection Annotations { get; }
Property Value
Area
Gets the current ChartArea that defines the plotting region and coordinate system for data visualization.
Declaration
[Browsable(false)]
public ChartArea Area { get; }
Property Value
AreaType
Gets or sets the chart area type that determines the coordinate system and layout for data visualization (Cartesian, Pie, Polar, or Funnel).
Declaration
public ChartAreaType AreaType { get; set; }
Property Value
Axes
Gets the collection of chart axes that define the coordinate system and scaling for the chart area.
Declaration
public ChartAxisCollection Axes { get; }
Property Value
ClientRectangle
Gets the client rectangle that defines the available drawing area for the chart.
Controllers
Gets the collection of chart view controllers that handle user interaction and chart behavior.
Declaration
public ChartViewControllerCollection Controllers { get; }
Property Value
DataMember
Gets or sets the name of the list or table in the data source for which the ChartSeries is bound.
Declaration
[Browsable(true)]
public string DataMember { get; set; }
Property Value
DataSource
Gets or sets the data source of the ChartSeries.
Margin
Gets or sets the margin around the chart area within the view boundaries.
MinSize
Gets or sets the minimum size constraints for the chart view.
Owner
Gets or sets the chart view host that owns and manages this chart view instance.
Declaration
public IChartViewHost Owner { get; set; }
Property Value
Palette
Gets or sets the color palette used to automatically assign colors to chart series elements.
Declaration
[Browsable(false)]
public ChartPalette Palette { get; set; }
Property Value
Renderer
Gets the chart renderer responsible for drawing and visualizing chart elements within the current chart area.
SelectionMode
Gets or sets the selection mode that determines how chart elements can be selected by the user.
Declaration
public ChartSelectionMode SelectionMode { get; set; }
Property Value
Series
Gets the collection of chart series that contain the data points and visualization settings for the chart.
Declaration
public ChartSeriesCollection Series { get; }
Property Value
ShowPanZoom
Gets or sets a value indicating whether the pan and zoom controller is activated for chart navigation.
ShowSmartLabels
Gets or sets a value indicating whether smart labels are enabled to prevent overlapping of chart labels.
ShowStillIndicators
Gets or sets a value indicating whether still indicators are displayed for static chart elements.
ShowToolTip
Gets or sets a value indicating whether tooltips are displayed when hovering over chart elements.
ShowTrackBall
Gets or sets a value indicating whether the track ball controller is shown for data point tracking.
UseDataSource
Gets or sets a value indicating whether to automatically configure the DataSource of each ChartSeries when null.
Declaration
[Browsable(true)]
public bool UseDataSource { get; set; }
Property Value
ViewName
Gets or sets the name identifier for this chart view, useful for drill-down navigation and view management.
ViewResult
Gets or sets the view result that contains information about the chart view's rendering and data processing state.
Methods
DeferRefresh()
Defers chart refresh operations until the returned IDisposable is disposed.
Declaration
public virtual IDisposable DeferRefresh()
Returns
An IDisposable that resumes refresh when disposed.
Draw(object)
Draws the chart view using the specified rendering context.
Declaration
public virtual void Draw(object context)
Parameters
context
The rendering context used for drawing operations.
GetArea<T>()
Gets the chart area cast to the specified type.
Declaration
public T GetArea<T>() where T : ChartArea
Returns
T
The chart area as the specified type, or null if the cast is invalid.
Layout()
Performs a layout pass to arrange chart elements and invalidates the display.
Declaration
public void Layout()
Layout(RadRect)
Performs a layout pass to arrange chart elements within the specified rectangle.
Declaration
public void Layout(RadRect rect)
Parameters
rect
The rectangle defining the viewport for layout arrangement.
Layout(bool)
Performs a layout pass to arrange chart elements with optional invalidation.
Declaration
public void Layout(bool redraw)
Parameters
redraw
A value indicating whether to invalidate and trigger a redraw after layout.
OnAttached(UIChartElement)
Called when the chart view is attached to a parent chart element.
Declaration
protected override void OnAttached(UIChartElement parent)
Parameters
parent
The parent chart element to which this view is being attached.
Overrides
OnAxisLabelFormatting(object, ChartAxisLabelFormattingEventArgs)
Raises the AxisLabelFormatting event.
Declaration
protected virtual void OnAxisLabelFormatting(object sender, ChartAxisLabelFormattingEventArgs e)
Parameters
sender
The label element that triggered the event.
e
ChartAxisLabelFormattingEventArgs
The ChartAxisLabelFormattingEventArgs containing the event data.
OnCreatePoint(ChartViewCreatePointEventArgs)
Raises the CreatePoint event.
Declaration
protected virtual void OnCreatePoint(ChartViewCreatePointEventArgs e)
Parameters
e
The ChartViewCreatePointEventArgs containing the event data.
OnCreatePointElement(ChartViewCreatePointElementEventArgs)
Raises the CreatePointElement event.
Declaration
protected virtual void OnCreatePointElement(ChartViewCreatePointElementEventArgs e)
Parameters
e
ChartViewCreatePointElementEventArgs
The ChartViewCreatePointElementEventArgs containing the event data.
OnCreateRenderer(object, ChartViewCreateRendererEventArgs)
Raises the CreateRenderer event.
Declaration
protected virtual void OnCreateRenderer(object sender, ChartViewCreateRendererEventArgs e)
Parameters
sender
The sender of the event.
e
ChartViewCreateRendererEventArgs
The ChartViewCreateRendererEventArgs containing the event data.
OnDataError(Exception)
Raises the DataError event when a data exception occurs.
Declaration
protected virtual void OnDataError(Exception exception)
Parameters
exception
The exception that caused the data error.
OnGesture(GestureEventArgs)
Raises the gesture event and processes it through all chart controllers.
Declaration
protected virtual void OnGesture(GestureEventArgs e)
Parameters
e
The GestureEventArgs containing the event data.
OnKeyDown(KeyEventArgs)
Raises the key down event and processes it through all chart controllers.
Declaration
protected virtual void OnKeyDown(KeyEventArgs e)
Parameters
e
The KeyEventArgs containing the event data.
OnKeyPress(KeyPressEventArgs)
Raises the key press event and processes it through all chart controllers.
Declaration
protected virtual void OnKeyPress(KeyPressEventArgs e)
Parameters
e
The KeyPressEventArgs containing the event data.
OnKeyUp(KeyEventArgs)
Raises the key up event and processes it through all chart controllers.
Declaration
protected virtual void OnKeyUp(KeyEventArgs e)
Parameters
e
The KeyEventArgs containing the event data.
OnLabelFormatting(object, ChartViewLabelFormattingEventArgs)
Raises the LabelFormatting event.
Declaration
protected virtual void OnLabelFormatting(object sender, ChartViewLabelFormattingEventArgs e)
Parameters
sender
The sender of the event.
e
ChartViewLabelFormattingEventArgs
The ChartViewLabelFormattingEventArgs containing the event data.
OnMouseCaptureChanged(EventArgs)
Raises the mouse capture changed event and processes it through all chart controllers.
OnMouseClick(MouseEventArgs)
Raises the mouse click event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseClick(MouseEventArgs e)
Parameters
e
The MouseEventArgs containing the event data.
OnMouseDoubleClick(MouseEventArgs)
Raises the mouse double click event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseDoubleClick(MouseEventArgs e)
Parameters
e
The MouseEventArgs containing the event data.
OnMouseDown(MouseEventArgs)
Raises the mouse down event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseDown(MouseEventArgs e)
Parameters
e
The MouseEventArgs containing the event data.
OnMouseEnter(EventArgs)
Raises the mouse enter event and processes it through all chart controllers.
OnMouseHover(EventArgs)
Raises the mouse hover event and processes it through all chart controllers.
OnMouseLeave(EventArgs)
Raises the mouse leave event and processes it through all chart controllers.
OnMouseMove(MouseEventArgs)
Raises the mouse move event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseMove(MouseEventArgs e)
Parameters
e
The MouseEventArgs containing the event data.
OnMouseUp(MouseEventArgs)
Raises the mouse up event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseUp(MouseEventArgs e)
Parameters
e
The MouseEventArgs containing the event data.
OnMouseWheel(MouseEventArgs)
Raises the mouse wheel event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseWheel(MouseEventArgs e)
Parameters
e
The MouseEventArgs containing the event data.
OnPanChanged(EventArgs)
Raises the PanChanged event.
OnPanChanging(PanChangingEventArgs)
Raises the PanChanging event.
Declaration
public virtual void OnPanChanging(PanChangingEventArgs e)
Parameters
e
The PanChangingEventArgs containing the event data.
OnPanGesture(PanGestureEventArgs)
Raises the pan gesture event and processes it through all chart controllers.
Declaration
protected virtual void OnPanGesture(PanGestureEventArgs e)
Parameters
e
The PanGestureEventArgs containing the event data.
OnPressAndTapGesture(PressAndTapGestureEventArgs)
Raises the press and tap gesture event and processes it through all chart controllers.
Declaration
protected void OnPressAndTapGesture(PressAndTapGestureEventArgs e)
Parameters
e
The PressAndTapGestureEventArgs containing the event data.
OnPropertyChanged(RadPropertyChangedEventArgs)
Raises the RadPropertyChanged event and the standard .NET PropertyChanged event to notify subscribers of property value changes.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
The RadPropertyChangedEventArgs containing information about the property change.
Overrides
OnRotateGesture(RotateGestureEventArgs)
Raises the rotate gesture event and processes it through all chart controllers.
Declaration
protected virtual void OnRotateGesture(RotateGestureEventArgs e)
Parameters
e
The RotateGestureEventArgs containing the event data.
OnSelectedPointChanged(ChartViewSelectedPointChangedEventArgs)
Raises the SelectedPointChanged event.
Declaration
protected virtual void OnSelectedPointChanged(ChartViewSelectedPointChangedEventArgs e)
Parameters
e
ChartViewSelectedPointChangedEventArgs
The ChartViewSelectedPointChangedEventArgs containing the event data.
OnSelectedPointChanging(ChartViewSelectedPointChangingEventArgs)
Raises the SelectedPointChanging event.
Declaration
protected virtual void OnSelectedPointChanging(ChartViewSelectedPointChangingEventArgs e)
Parameters
e
ChartViewSelectedPointChangingEventArgs
The ChartViewSelectedPointChangingEventArgs containing the event data.
OnTwoFingerTapGesture(GestureEventArgs)
Raises the two finger tap gesture event and processes it through all chart controllers.
Declaration
protected virtual void OnTwoFingerTapGesture(GestureEventArgs e)
Parameters
e
The GestureEventArgs containing the event data.
OnZoomChanged(EventArgs)
Raises the ZoomChanged event.
OnZoomChanging(ZoomChangingEventArgs)
Raises the ZoomChanging event.
Declaration
public virtual void OnZoomChanging(ZoomChangingEventArgs e)
Parameters
e
The ZoomChangingEventArgs containing the event data.
OnZoomGesture(ZoomGestureEventArgs)
Raises the zoom gesture event and processes it through all chart controllers.
Declaration
protected virtual void OnZoomGesture(ZoomGestureEventArgs e)
Parameters
e
The ZoomGestureEventArgs containing the event data.
Pan(double, double)
Pans the chart view by the specified offset values.
PerformRefresh(UIChartElement, bool)
Performs a refresh operation on the chart view for the specified element.
Declaration
public void PerformRefresh(UIChartElement element, bool updateLayout)
Parameters
element
The chart element that triggered the refresh request.
updateLayout
A value indicating whether to perform a full layout update.
ProcessResult(ActionResult)
Processes the action result returned by chart controllers.
Declaration
protected virtual bool ProcessResult(ActionResult actionResult)
Parameters
actionResult
The action result to process.
Returns
A value indicating whether the result was successfully processed.
Reset()
Resets the chart view by clearing axis states and performing a layout update.
Declaration
public void Reset()
ResumeRefresh()
Resumes chart refresh operations and triggers a refresh if needed.
Declaration
public void ResumeRefresh()
SuspendRefresh()
Suspends chart refresh operations to improve performance during multiple updates.
Declaration
public void SuspendRefresh()
UpdatePanOnZoom(double, double)
Updates the pan offset when zoom changes to maintain proper chart positioning.
Zoom(double, double)
Zooms the chart view using the specified horizontal and vertical scale factors.
Events
AxisLabelFormatting
Occurs when the content of a axis label needs to be formatted for display.
Declaration
[Browsable(true)]
public event ChartAxisLabelFormattingEventHandler AxisLabelFormatting
Event Value
CreatePoint
Occurs when a new data point is created, allowing customization of data points.
Declaration
public event ChartViewCreatePointEventHandler CreatePoint
Event Value
CreatePointElement
Occurs when a new data point element is created, allowing customization of point elements.
Declaration
public event ChartViewCreatePointElementEventHandler CreatePointElement
Event Value
CreateRenderer
Occurs when the chart area requires a renderer for the first time, allowing custom renderer creation.
Declaration
public event ChartViewCreateRendererEventHandler CreateRenderer
Event Value
DataError
Occurs when a data error is detected during chart operations.
Declaration
public event ChartViewDataErrorEventHandler DataError
Event Value
LabelFormatting
Occurs when the content of a point label needs to be formatted for display.
Declaration
[Browsable(true)]
public event ChartViewLabelFormattingEventHandler LabelFormatting
Event Value
PanChanged
Occurs when the pan position has changed.
PanChanging
Occurs when the pan position is about to change, allowing cancellation of the pan operation.
Declaration
public event PanChangingEventHandler PanChanging
Event Value
SelectedPointChanged
Occurs when the selected point has changed.
Declaration
public event ChartViewSelectedChangedEventHandler SelectedPointChanged
Event Value
SelectedPointChanging
Occurs when the selected point is about to change, allowing cancellation of the selection.
Declaration
public event ChartViewSelectedChangingEventHandler SelectedPointChanging
Event Value
ZoomChanged
Occurs when the zoom level has changed.
ZoomChanging
Occurs when the zoom level is about to change, allowing cancellation of the zoom operation.
Declaration
public event ZoomChangingEventHandler ZoomChanging
Event Value