Class RadChart
RadChart is a powerful data visualization control that allows you to display various 2D and 3D chart series types. The control can be easily customized via control templates, provides databinding support, display animations out-of-the-box, and supports one or multiple ChartAreas in order to display multiple categories of data at the same time.
Inheritance
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.Charting.dll
Syntax
[TelerikToolboxCategory("Data Visualization")]
public class RadChart : ContentControl, IInteractionManager, IInteractiveElement, IThemable, ILogicalItem
Constructors
RadChart()
Fields
AnimationSettingsProperty
Identifies the Animation
Declaration
public static readonly DependencyProperty AnimationSettingsProperty
Field Value
System.
|
AxisElementBrushProperty
Identifies the Axis
Declaration
public static readonly DependencyProperty AxisElementBrushProperty
Field Value
System.
|
AxisForegroundProperty
Identifies the Axis
Declaration
public static readonly DependencyProperty AxisForegroundProperty
Field Value
System.
|
DefaultViewProperty
Identifies the Default
Declaration
public static readonly DependencyProperty DefaultViewProperty
Field Value
System.
|
FilterDescriptorsProperty
Identifies the Filter
Declaration
public static readonly DependencyProperty FilterDescriptorsProperty
Field Value
System.
|
HierarchicalViewDescriptorsProperty
Identifies the Hierarchical
Declaration
public static readonly DependencyProperty HierarchicalViewDescriptorsProperty
Field Value
System.
|
HierarchyManagerProperty
Identifies the Hierarchy
Declaration
public static readonly DependencyProperty HierarchyManagerProperty
Field Value
System.
|
HoverActivationDelayProperty
Identifies the Hover
Declaration
public static readonly DependencyProperty HoverActivationDelayProperty
Field Value
System.
|
ItemsSourceProperty
Identifies the Items
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
System.
|
LegendStyleProperty
Identifies the Legend
Declaration
public static readonly DependencyProperty LegendStyleProperty
Field Value
System.
|
MinFullHeightProperty
Identifies the Min
Declaration
public static readonly DependencyProperty MinFullHeightProperty
Field Value
System.
|
MinFullWidthProperty
Identifies the Min
Declaration
public static readonly DependencyProperty MinFullWidthProperty
Field Value
System.
|
PaletteBrushesProperty
Identifies the Palette
Declaration
public static readonly DependencyProperty PaletteBrushesProperty
Field Value
System.
|
PaletteBrushesRepeatProperty
Identifies the Palette
Declaration
public static readonly DependencyProperty PaletteBrushesRepeatProperty
Field Value
System.
|
PaletteBrushesUseSolidColorsProperty
Identifies the Palette
Declaration
public static readonly DependencyProperty PaletteBrushesUseSolidColorsProperty
Field Value
System.
|
SamplingSettingsProperty
Identifies the Sampling
Declaration
public static readonly DependencyProperty SamplingSettingsProperty
Field Value
System.
|
SeriesMappingsProperty
Identifies the Series
Declaration
public static readonly DependencyProperty SeriesMappingsProperty
Field Value
System.
|
SortDescriptorsProperty
Identifies the Sort
Declaration
public static readonly DependencyProperty SortDescriptorsProperty
Field Value
System.
|
TimeBarProperty
Identifies the Time
Declaration
public static readonly DependencyProperty TimeBarProperty
Field Value
System.
|
TitleStyleProperty
Identifies the Title
Declaration
public static readonly DependencyProperty TitleStyleProperty
Field Value
System.
|
UseDefaultLayoutProperty
Identifies the Use
Declaration
public static readonly DependencyProperty UseDefaultLayoutProperty
Field Value
System.
|
Properties
AnimationSettings
Gets or sets the animation settings for the contained DataSeries.
Declaration
public AnimationSettings AnimationSettings { get; set; }
Property Value
Animation The animation settings. |
AxisElementBrush
Gets or sets the a brush used for all axis line elements.
Declaration
public Brush AxisElementBrush { get; set; }
Property Value
System.
|
AxisForeground
Gets or sets the axis foreground.
Declaration
public Brush AxisForeground { get; set; }
Property Value
System.
|
CreateItemStyleDelegate
Gets or sets a delegate that allows you to generate a new user defined System.
The delegate accepts four parameters:
-
First parameter is a System.
Windows. instance that represents the chart item that is currently processed. This could be either a derivative of BaseControls. Control Chart , or a derivative of SelfItem Drawing , or a SeriesSeries Item , or a ChartLabel Legend .Item -
Second parameter is the System.
Windows. that would be applied to the respective chart item by default. You can use it to set the Style.BasedOn property of the user defined style you are generating.Style -
Third parameter is the respective Data
Point associated with the chart item. Note that argument will be null if the chart item is a SelfDrawing .Series -
Fourth parameter is the respective Data
Series associated with the chart item.
Declaration
public Func<Control, Style, DataPoint, DataSeries, Style> CreateItemStyleDelegate { get; set; }
Property Value
System.
|
DefaultSeriesDefinition
Gets or sets the default SeriesDefinition for a data bound chart.
Declaration
public ISeriesDefinition DefaultSeriesDefinition { get; set; }
Property Value
ISeries The default value is BarSeriesDefinition. |
DefaultView
Gets or sets the default view of RadChart.
Declaration
public ChartDefaultView DefaultView { get; set; }
Property Value
Remarks
The default view contains a basic layout with a single chart area, legend, and title within a grid panel. You can still add additional elements (chart areas, legends, titles) as content of the RadChart control; alternatively you can modify the template as well.
FilterDescriptors
Gets the filter descriptors collection.
Declaration
public ChartFilterDescriptorCollection FilterDescriptors { get; }
Property Value
HierarchicalViewDescriptors
Gets the sort descriptors collection.
Declaration
public ChartHierarchicalViewDescriptorCollection HierarchicalViewDescriptors { get; }
Property Value
HierarchyManager
Gets or sets an instance of HierarchyManager. This object is in charge of hierarchical operations in RadChart.
Declaration
public HierarchyManager HierarchyManager { get; set; }
Property Value
Hierarchy The HierarchyManager. |
HoverActivationDelay
Gets or sets the delay before the hover interactivity effect is activated.
Declaration
public Duration HoverActivationDelay { get; set; }
Property Value
System.
|
Remarks
The default value is zero i.e. the hover effect is activated immediately.
ItemsSource
Gets or sets a collection used to generate the content of the RadChart control. This is a dependency property.
Declaration
public object ItemsSource { get; set; }
Property Value
System.
|
LegendStyle
Gets or sets the legend style.
Declaration
public Style LegendStyle { get; set; }
Property Value
System. The legend style. |
MinFullHeight
Gets or sets the height under which the chart will be scaled down.
Declaration
public double MinFullHeight { get; set; }
Property Value
System. The height. |
MinFullWidth
Gets or sets the width under which the chart will be scaled down.
Declaration
public double MinFullWidth { get; set; }
Property Value
System. The width. |
PaletteBrushes
Gets or sets the brushes that are to be used with the Series.
Declaration
public BrushCollection PaletteBrushes { get; set; }
Property Value
Brush The series brushes. |
PaletteBrushesRepeat
Gets or sets value indicating whether the brushes added will be used in cyclic fashion.
Declaration
public bool PaletteBrushesRepeat { get; set; }
Property Value
System. The series brushes. |
PaletteBrushesUseSolidColors
Gets or sets value indicating whether the brushes in the palette should use solid colors.
Declaration
public bool PaletteBrushesUseSolidColors { get; set; }
Property Value
System. The series brushes. |
SamplingSettings
Gets the sampling settings. The sampling settings are used to allow data sampling in RadChart - grouping several adjacent datapoints into a single point.
Declaration
public SamplingSettings SamplingSettings { get; set; }
Property Value
Sampling The sampling settings. |
SeriesMappings
Gets or sets the collection of mappings that defines the relations between the data passed to the chart and the chart series fields (YValue, XValue, etc.) that should be bound to the passed data.
Declaration
public SeriesMappingCollection SeriesMappings { get; set; }
Property Value
Remarks
You need to add a separate mapping item for each chart series that you would like to display in the chart control.
SortDescriptors
Gets the hierarchical view descriptors collection.
Declaration
public ChartSortDescriptorCollection SortDescriptors { get; }
Property Value
StyleBuilder
This property supports the RadChart infrastructure and is not intended to be used directly from your code.
Declaration
public StyleBuilderData StyleBuilder { get; set; }
Property Value
TimeBar
Gets or sets the TimeBar.
Declaration
public IRangeSelector<DateTime> TimeBar { get; set; }
Property Value
IRange
|
TitleStyle
Gets or sets the title style.
Declaration
public Style TitleStyle { get; set; }
Property Value
System. The title style. |
UseDefaultLayout
Gets or sets a value indicating whether the default layout of the charting control should be used.
Declaration
public bool UseDefaultLayout { get; set; }
Property Value
System. The default value is true. |
Remarks
You should set this property to false if you would like to customize the layout of the control entirely through the Content property of the control. Alternatively you can overwrite the control template and change the default layout there, or use a combination of the default layout (from the template) and layout specified in the Content property of the control.
Methods
ExportToExcelML(Stream)
Exports an image of the given element to the Excel file.
Declaration
public void ExportToExcelML(Stream stream)
Parameters
System. Stream. |
ExportToExcelML(String)
Exports an image of the given element to the Excel file.
Declaration
public void ExportToExcelML(string fileName)
Parameters
System. Name of the Excel file. |
ExportToImage(Stream)
Exports an image of the given element to stream using PngBitmapEncoder.
Declaration
public void ExportToImage(Stream stream)
Parameters
System. Stream to write image to. |
ExportToImage(Stream, Double, Double, BitmapEncoder)
Exports an image of the given element to stream using the specified bitmap encoder.
Declaration
public void ExportToImage(Stream stream, double dpiHorizontal, double dpiVertical, BitmapEncoder encoder)
Parameters
System. Stream to write image to. |
System. The horizontal dpi setting. |
System. The vertical dpi setting. |
System. Bitmap encoder. |
ExportToImage(Stream, BitmapEncoder)
Exports an image of the given element to stream using the specified bitmap encoder.
Declaration
public void ExportToImage(Stream stream, BitmapEncoder encoder)
Parameters
System. Stream to write image to. |
System. Bitmap encoder. |
ExportToImage(String)
Exports an image of the given element to file using PngBitmapEncoder.
Declaration
public void ExportToImage(string fileName)
Parameters
System. Name of the file to write image to. |
ExportToImage(String, Double, Double, BitmapEncoder)
Exports an image of the given element to file using the specified bitmap encoder.
Declaration
public void ExportToImage(string fileName, double dpiHorizontal, double dpiVertical, BitmapEncoder encoder)
Parameters
System. Name of the file to write image to. |
System. The horizontal dpi setting. |
System. The vertical dpi setting. |
System. Bitmap encoder. |
ExportToImage(String, BitmapEncoder)
Exports an image of the given element to file using the specified bitmap encoder.
Declaration
public void ExportToImage(string fileName, BitmapEncoder encoder)
Parameters
System. Name of the file to write image to. |
System. Bitmap encoder. |
ExportToXps(Stream)
Exports an image of the given element to the Xps file.
Declaration
public void ExportToXps(Stream stream)
Parameters
System. Stream. |
ExportToXps(String)
Exports an image of the given element to the Xps file.
Declaration
public void ExportToXps(string fileName)
Parameters
System. Name of the Xps file. |
MeasureOverride(Size)
Called to measure a control.
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
System. The maximum size that the method can return. |
Returns
System. The size of the control, up to the maximum specified by |
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call System.
Declaration
public override void OnApplyTemplate()
OnDataBinding(ChartDataBindingEventArgs)
Called before the chart is data bound.
Declaration
protected virtual void OnDataBinding(ChartDataBindingEventArgs e)
Parameters
OnDataBound(ChartDataBoundEventArgs)
Called when the chart is data bound.
Declaration
protected virtual void OnDataBound(ChartDataBoundEventArgs e)
Parameters
OnInitialized(EventArgs)
Raises the System.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
System. The System. |
OnItemDataBound(ChartItemDataBoundEventArgs)
Occurs when a DataPoint is created through databinding.
Declaration
protected virtual void OnItemDataBound(ChartItemDataBoundEventArgs e)
Parameters
Rebind()
Rebinds this RadChart instance.
Declaration
public void Rebind()
ResetTheme()
Resets the theme.
Declaration
public void ResetTheme()
Save()
Saves the chart to a stream using PngBitmapEncoder.
Declaration
public Stream Save()
Returns
System. A Stream object containing the chart. |
Save(Double, Double)
Saves the chart to a stream using PngBitmapEncoder.
Declaration
public Stream Save(double dpiHorizontal, double dpiVertical)
Parameters
System. The horizontal dpi setting. |
System. The vertical dpi setting. |
Returns
System. A Stream object containing the chart. |
Save(Double, Double, BitmapEncoder)
Saves the chart to a stream using the specified bitmap encoder.
Declaration
public Stream Save(double dpiHorizontal, double dpiVertical, BitmapEncoder encoder)
Parameters
System. The horizontal dpi setting. |
System. The vertical dpi setting. |
System. An instance of BitmapEncoder. Use this parameter to define the output image type. |
Returns
System. A Stream object containing the chart. |
Save(String)
Saves the chart to a file using PngBitmapEncoder.
Declaration
public void Save(string fileName)
Parameters
System. Name of the file to write image to. |
Save(String, Double, Double)
Saves the chart to a file using PngBitmapEncoder.
Declaration
public void Save(string fileName, double dpiHorizontal, double dpiVertical)
Parameters
System. Name of the file to write image to. |
System. The horizontal dpi setting. |
System. The vertical dpi setting. |
Save(String, Double, Double, BitmapEncoder)
Saves the chart to a file using the specified bitmap encoder.
Declaration
public void Save(string fileName, double dpiHorizontal, double dpiVertical, BitmapEncoder encoder)
Parameters
System. Name of the file to write image to. |
System. The horizontal dpi setting. |
System. The vertical dpi setting. |
System. Bitmap encoder. |
UpdateLogicalChildren()
This method supports the RadChart infrastructure and is not intended to be used directly from your code.
Declaration
public void UpdateLogicalChildren()
Remarks
Call this method only in case you are using the control with non-default layout and you are changing it dynamically (i.e. add/remove ChartArea instances on the fly).
Events
DataBinding
Occurs before the chart is data bound.
Declaration
public event EventHandler<ChartDataBindingEventArgs> DataBinding
Event Type
System.
|
DataBound
Occurs when the chart is data bound.
Declaration
public event EventHandler<ChartDataBoundEventArgs> DataBound
Event Type
System.
|
ItemDataBound
Occurs when a DataPoint is created through databinding.
Declaration
public event EventHandler<ChartItemDataBoundEventArgs> ItemDataBound
Event Type
System.
|