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