Class ChartView
Represents the core chart view element that manages chart areas, series, data binding, and visualization rendering within a chart control.
Inherited Members
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
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
|
IChartViewHost
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
|
RadChartElement
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
|
RadChartView
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.
Declaration
public static RadProperty MarginProperty
Field Value
|
RadProperty
|
MinSizeProperty
Identifies the MinSize dependency property that defines the minimum size constraints for the chart view.
Declaration
public static RadProperty MinSizeProperty
Field Value
|
RadProperty
|
Properties
Annotations
Gets the collection of chart annotations that provide additional visual elements overlaid on the chart.
Declaration
public ChartAnnotationCollection Annotations { get; }
Property Value
|
ChartAnnotationCollection
|
Area
Gets the current ChartArea that defines the plotting region and coordinate system for data visualization.
Declaration
public ChartArea Area { get; }
Property Value
|
ChartArea
|
AreaDesign
This property is not relevant for this class.
Declaration
public ChartArea AreaDesign { get; set; }
Property Value
|
ChartArea
|
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
|
ChartAreaType
|
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
|
ChartAxisCollection
|
ClientRectangle
Gets the client rectangle that defines the available drawing area for the chart.
Declaration
public RectangleF ClientRectangle { get; }
Property Value
|
System.Drawing.RectangleF
|
Controllers
Gets the collection of chart view controllers that handle user interaction and chart behavior.
Declaration
public ChartViewControllerCollection Controllers { get; }
Property Value
|
ChartViewControllerCollection
|
DataMember
Gets or sets the name of the list or table in the data source for which the ChartSeries is bound.
Declaration
public string DataMember { get; set; }
Property Value
|
System.String
|
DataSource
Gets or sets the data source of the ChartSeries.
Declaration
public object DataSource { get; set; }
Property Value
|
System.Object
|
Margin
Gets or sets the margin around the chart area within the view boundaries.
Declaration
public Padding Margin { get; set; }
Property Value
|
System.Windows.Forms.Padding
|
MinSize
Gets or sets the minimum size constraints for the chart view.
Declaration
public SizeF MinSize { get; set; }
Property Value
|
System.Drawing.SizeF
|
Owner
Gets or sets the chart view host that owns and manages this chart view instance.
Declaration
public IChartViewHost Owner { get; set; }
Property Value
|
IChartViewHost
|
Palette
Gets or sets the color palette used to automatically assign colors to chart series elements.
Declaration
public ChartPalette Palette { get; set; }
Property Value
|
ChartPalette
|
Renderer
Gets the chart renderer responsible for drawing and visualizing chart elements within the current chart area.
Declaration
public IChartRenderer Renderer { get; }
Property Value
|
IChartRenderer
|
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
|
ChartSelectionMode
|
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
|
ChartSeriesCollection
|
ShowPanZoom
Gets or sets a value indicating whether the pan and zoom controller is activated for chart navigation.
Declaration
public bool ShowPanZoom { get; set; }
Property Value
|
System.Boolean
|
ShowSmartLabels
Gets or sets a value indicating whether smart labels are enabled to prevent overlapping of chart labels.
Declaration
public bool ShowSmartLabels { get; set; }
Property Value
|
System.Boolean
|
ShowStillIndicators
Gets or sets a value indicating whether still indicators are displayed for static chart elements.
Declaration
public bool ShowStillIndicators { get; set; }
Property Value
|
System.Boolean
|
ShowToolTip
Gets or sets a value indicating whether tooltips are displayed when hovering over chart elements.
Declaration
public bool ShowToolTip { get; set; }
Property Value
|
System.Boolean
|
ShowTrackBall
Gets or sets a value indicating whether the track ball controller is shown for data point tracking.
Declaration
public bool ShowTrackBall { get; set; }
Property Value
|
System.Boolean
|
UseDataSource
Gets or sets a value indicating whether to automatically configure the DataSource of each ChartSeries when null.
Declaration
public bool UseDataSource { get; set; }
Property Value
|
System.Boolean
|
ViewName
Gets or sets the name identifier for this chart view, useful for drill-down navigation and view management.
Declaration
public virtual string ViewName { get; set; }
Property Value
|
System.String
|
Viewport
Gets or sets the viewport rectangle that defines the visible chart area.
Declaration
public RadRect Viewport { get; set; }
Property Value
|
RadRect
|
ViewResult
Gets or sets the view result that contains information about the chart view's rendering and data processing state.
Declaration
public ViewResult ViewResult { get; set; }
Property Value
|
ViewResult
|
Methods
DeferRefresh()
Defers chart refresh operations until the returned System.IDisposable is disposed.
Declaration
public virtual IDisposable DeferRefresh()
Returns
|
System.IDisposable
An System.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
|
System.Object
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. |
Type Parameters
|
T
The type of chart area to retrieve. |
Layout()
Performs a layout pass to arrange chart elements and invalidates the display.
Declaration
public void Layout()
Layout(Boolean)
Performs a layout pass to arrange chart elements with optional invalidation.
Declaration
public void Layout(bool redraw)
Parameters
|
System.Boolean
redraw
A value indicating whether to invalidate and trigger a redraw after layout. |
Layout(RadRect)
Performs a layout pass to arrange chart elements within the specified rectangle.
Declaration
public void Layout(RadRect rect)
Parameters
|
RadRect
rect
The rectangle defining the viewport for layout arrangement. |
OnAttached(UIChartElement)
Called when the chart view is attached to a parent chart element.
Declaration
protected override void OnAttached(UIChartElement parent)
Parameters
|
UIChartElement
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
|
System.Object
sender
The label element that triggered the event. |
|
ChartAxisLabelFormattingEventArgs
e
The ChartAxisLabelFormattingEventArgs containing the event data. |
OnCreatePoint(ChartViewCreatePointEventArgs)
Raises the CreatePoint event.
Declaration
protected virtual void OnCreatePoint(ChartViewCreatePointEventArgs e)
Parameters
|
ChartViewCreatePointEventArgs
e
The ChartViewCreatePointEventArgs containing the event data. |
OnCreatePointElement(ChartViewCreatePointElementEventArgs)
Raises the CreatePointElement event.
Declaration
protected virtual void OnCreatePointElement(ChartViewCreatePointElementEventArgs e)
Parameters
|
ChartViewCreatePointElementEventArgs
e
The ChartViewCreatePointElementEventArgs containing the event data. |
OnCreateRenderer(Object, ChartViewCreateRendererEventArgs)
Raises the CreateRenderer event.
Declaration
protected virtual void OnCreateRenderer(object sender, ChartViewCreateRendererEventArgs e)
Parameters
|
System.Object
sender
The sender of the event. |
|
ChartViewCreateRendererEventArgs
e
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
|
System.Exception
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
|
GestureEventArgs
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
|
System.Windows.Forms.KeyEventArgs
e
The System.Windows.Forms.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
|
System.Windows.Forms.KeyPressEventArgs
e
The System.Windows.Forms.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
|
System.Windows.Forms.KeyEventArgs
e
The System.Windows.Forms.KeyEventArgs containing the event data. |
OnLabelFormatting(Object, ChartViewLabelFormattingEventArgs)
Raises the LabelFormatting event.
Declaration
protected virtual void OnLabelFormatting(object sender, ChartViewLabelFormattingEventArgs e)
Parameters
|
System.Object
sender
The sender of the event. |
|
ChartViewLabelFormattingEventArgs
e
The ChartViewLabelFormattingEventArgs containing the event data. |
OnMouseCaptureChanged(EventArgs)
Raises the mouse capture changed event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseCaptureChanged(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing the event data. |
OnMouseClick(MouseEventArgs)
Raises the mouse click event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseClick(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
The System.Windows.Forms.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
|
System.Windows.Forms.MouseEventArgs
e
The System.Windows.Forms.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
|
System.Windows.Forms.MouseEventArgs
e
The System.Windows.Forms.MouseEventArgs containing the event data. |
OnMouseEnter(EventArgs)
Raises the mouse enter event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseEnter(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing the event data. |
OnMouseHover(EventArgs)
Raises the mouse hover event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseHover(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing the event data. |
OnMouseLeave(EventArgs)
Raises the mouse leave event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseLeave(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing the event data. |
OnMouseMove(MouseEventArgs)
Raises the mouse move event and processes it through all chart controllers.
Declaration
protected virtual void OnMouseMove(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
The System.Windows.Forms.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
|
System.Windows.Forms.MouseEventArgs
e
The System.Windows.Forms.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
|
System.Windows.Forms.MouseEventArgs
e
The System.Windows.Forms.MouseEventArgs containing the event data. |
OnPanChanged(EventArgs)
Raises the PanChanged event.
Declaration
public virtual void OnPanChanged(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing the event data. |
OnPanChanging(PanChangingEventArgs)
Raises the PanChanging event.
Declaration
public virtual void OnPanChanging(PanChangingEventArgs e)
Parameters
|
PanChangingEventArgs
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
|
PanGestureEventArgs
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
|
PressAndTapGestureEventArgs
e
The PressAndTapGestureEventArgs containing the event data. |
OnPropertyChanged(RadPropertyChangedEventArgs)
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
|
RadPropertyChangedEventArgs
e
|
Overrides
OnRotateGesture(RotateGestureEventArgs)
Raises the rotate gesture event and processes it through all chart controllers.
Declaration
protected virtual void OnRotateGesture(RotateGestureEventArgs e)
Parameters
|
RotateGestureEventArgs
e
The RotateGestureEventArgs containing the event data. |
OnSelectedPointChanged(ChartViewSelectedPointChangedEventArgs)
Raises the SelectedPointChanged event.
Declaration
protected virtual void OnSelectedPointChanged(ChartViewSelectedPointChangedEventArgs e)
Parameters
|
ChartViewSelectedPointChangedEventArgs
e
The ChartViewSelectedPointChangedEventArgs containing the event data. |
OnSelectedPointChanging(ChartViewSelectedPointChangingEventArgs)
Raises the SelectedPointChanging event.
Declaration
protected virtual void OnSelectedPointChanging(ChartViewSelectedPointChangingEventArgs e)
Parameters
|
ChartViewSelectedPointChangingEventArgs
e
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
|
GestureEventArgs
e
The GestureEventArgs containing the event data. |
OnZoomChanged(EventArgs)
Raises the ZoomChanged event.
Declaration
public virtual void OnZoomChanged(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing the event data. |
OnZoomChanging(ZoomChangingEventArgs)
Raises the ZoomChanging event.
Declaration
public virtual void OnZoomChanging(ZoomChangingEventArgs e)
Parameters
|
ZoomChangingEventArgs
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
|
ZoomGestureEventArgs
e
The ZoomGestureEventArgs containing the event data. |
Pan(Double, Double)
Pans the chart view by the specified offset values.
Declaration
public void Pan(double offsetX, double offsetY)
Parameters
|
System.Double
offsetX
The horizontal offset for panning. |
|
System.Double
offsetY
The vertical offset for panning. |
PerformRefresh(UIChartElement, Boolean)
Performs a refresh operation on the chart view for the specified element.
Declaration
public void PerformRefresh(UIChartElement element, bool updateLayout)
Parameters
|
UIChartElement
element
The chart element that triggered the refresh request. |
|
System.Boolean
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
actionResult
The action result to process. |
Returns
|
System.Boolean
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.
Declaration
protected virtual void UpdatePanOnZoom(double horizontalScaleFactor, double verticalScaleFactor)
Parameters
|
System.Double
horizontalScaleFactor
The new horizontal scale factor. |
|
System.Double
verticalScaleFactor
The new vertical scale factor. |
Zoom(Double, Double)
Zooms the chart view using the specified horizontal and vertical scale factors.
Declaration
public void Zoom(double horizontalScaleFactor, double verticalScaleFactor)
Parameters
|
System.Double
horizontalScaleFactor
The horizontal scale factor (between 1 and 100). |
|
System.Double
verticalScaleFactor
The vertical scale factor (between 1 and 100). |
Events
AxisLabelFormatting
Occurs when the content of a axis label needs to be formatted for display.
Declaration
public event ChartAxisLabelFormattingEventHandler AxisLabelFormatting
Event Type
|
ChartAxisLabelFormattingEventHandler
|
CreatePoint
Occurs when a new data point is created, allowing customization of data points.
Declaration
public event ChartViewCreatePointEventHandler CreatePoint
Event Type
|
ChartViewCreatePointEventHandler
|
CreatePointElement
Occurs when a new data point element is created, allowing customization of point elements.
Declaration
public event ChartViewCreatePointElementEventHandler CreatePointElement
Event Type
|
ChartViewCreatePointElementEventHandler
|
CreateRenderer
Occurs when the chart area requires a renderer for the first time, allowing custom renderer creation.
Declaration
public event ChartViewCreateRendererEventHandler CreateRenderer
Event Type
|
ChartViewCreateRendererEventHandler
|
DataError
Occurs when a data error is detected during chart operations.
Declaration
public event ChartViewDataErrorEventHandler DataError
Event Type
|
ChartViewDataErrorEventHandler
|
LabelFormatting
Occurs when the content of a point label needs to be formatted for display.
Declaration
public event ChartViewLabelFormattingEventHandler LabelFormatting
Event Type
|
ChartViewLabelFormattingEventHandler
|
PanChanged
Occurs when the pan position has changed.
Declaration
public event EventHandler PanChanged
Event Type
|
System.EventHandler
|
PanChanging
Occurs when the pan position is about to change, allowing cancellation of the pan operation.
Declaration
public event PanChangingEventHandler PanChanging
Event Type
|
PanChangingEventHandler
|
SelectedPointChanged
Occurs when the selected point has changed.
Declaration
public event ChartViewSelectedChangedEventHandler SelectedPointChanged
Event Type
|
ChartViewSelectedChangedEventHandler
|
SelectedPointChanging
Occurs when the selected point is about to change, allowing cancellation of the selection.
Declaration
public event ChartViewSelectedChangingEventHandler SelectedPointChanging
Event Type
|
ChartViewSelectedChangingEventHandler
|
ZoomChanged
Occurs when the zoom level has changed.
Declaration
public event EventHandler ZoomChanged
Event Type
|
System.EventHandler
|
ZoomChanging
Occurs when the zoom level is about to change, allowing cancellation of the zoom operation.
Declaration
public event ZoomChangingEventHandler ZoomChanging
Event Type
|
ZoomChangingEventHandler
|
Explicit Interface Implementations
IChartElementPresenter.InvalidatePalette()
Declaration
void IChartElementPresenter.InvalidatePalette()
Implements
IChartElementPresenter.IsVisible
Declaration
bool IChartElementPresenter.IsVisible { get; }
Returns
|
System.Boolean
|
Implements
IChartElementPresenter.MeasureContent(ChartNode, Object)
Declaration
RadSize IChartElementPresenter.MeasureContent(ChartNode owner, object content)
Parameters
|
ChartNode
owner
|
|
System.Object
content
|
Returns
|
RadSize
|
Implements
IChartElementPresenter.RefreshNode(ChartNode)
Declaration
void IChartElementPresenter.RefreshNode(ChartNode node)
Parameters
|
ChartNode
node
|
Implements
IChartView.PlotAreaClip
IChartView.PlotOriginX
Declaration
double IChartView.PlotOriginX { get; }
Returns
|
System.Double
|
Implements
IChartView.PlotOriginY
Declaration
double IChartView.PlotOriginY { get; }
Returns
|
System.Double
|
Implements
IChartView.ViewportHeight
Declaration
double IChartView.ViewportHeight { get; }
Returns
|
System.Double
|
Implements
IChartView.ViewportWidth
Declaration
double IChartView.ViewportWidth { get; }
Returns
|
System.Double
|
Implements
IChartView.ZoomHeight
Declaration
double IChartView.ZoomHeight { get; }
Returns
|
System.Double
|
Implements
IChartView.ZoomWidth
Declaration
double IChartView.ZoomWidth { get; }
Returns
|
System.Double
|