ChartView
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Displays themed charts with mixed series, data binding, interactive legends, and zoom.
- C#
- VB.NET
public class ChartView : Control
Public Class ChartView
Inherits Control
Derives from or implements Control, IWisejControl.
- DataSource Gets or sets the shared enumerable or list source used by series without a source.
- Legend Gets or sets the position of the interactive legend.
- Tooltip Gets or sets single, shared, or disabled point tooltips.
Example:
var chart = new ChartView { DataSource = sales };
chart.Series.Add(new ChartSeries { Name = "Revenue", ChartType = ChartType.Column, ValueMember = "Revenue", CategoryMember = "Quarter" });
this.Controls.Add(chart);
Constructors
ChartView()
Creates a chart and observes changes to its series, axes, and annotations.
Properties
Animated
Boolean: Gets or sets whether chart updates fade into view. (Default: True)
Annotations
ChartAnnotationCollection: Gets the observable Annotations configuration.
Crosshair
Boolean: Gets or sets whether the hovered coordinate is marked by a guide line. (Default: True)
DataSource
Object: Gets or sets the shared enumerable or list source used by series without a source. (Default: null)
DefaultSize
Size: Gets the default chart size.
EmptyState
String: Gets or sets the message displayed when no series has samples. (Default: null)
Null uses the built-in text for the current UI culture. An empty string suppresses the text.
KeyboardHelpText
String: Gets or sets the localized override for the "Use arrow keys to inspect points, Enter to activate, Escape to reset zoom." text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.
Legend
ChartLegend: Gets or sets the position of the interactive legend. (Default: Top)
Palette
Color[]: Gets or sets a copied array of series colors. An empty array uses theme defaults.
Series
SeriesCollection: Gets the observable Series configuration.
SeriesText
String: Gets or sets the localized override for the "Series {0}" text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation. {0} is the one-based series number. Literal braces can be written as {{ and }}.
Title
String: Gets or sets the chart title. (Default: "")
TonePalette
ChartTone[]: Gets or sets a copied array of series colors. An empty array uses theme defaults.
Tooltip
ChartTooltip: Gets or sets single, shared, or disabled point tooltips. (Default: Shared)
XAxis
ChartAxis: Gets the observable XAxis configuration.
Y2Axis
ChartAxis: Gets the observable Y2Axis configuration.
YAxis
ChartAxis: Gets the observable YAxis configuration.
ZoomMode
ChartZoomMode: Gets or sets the axes affected by drag zoom. Double-click resets zoom. (Default: Off)
Methods
Dispose(disposing)
Releases notifications from shared series and axis models.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | Whether managed resources are being released. |
ExportImage(format, fileName)
Downloads the currently rendered chart, including zoom, legend, and theme colors.
| Parameter | Type | Description |
|---|---|---|
| format | ChartImageFormat | SVG or PNG. |
| fileName | String | Suggested download name, without an extension. |
Export runs in the client browser after the control has appeared. PNG uses the rendered SVG at device resolution.
OnLegendItemClick(e)
Raises LegendItemClick.
| Parameter | Type | Description |
|---|---|---|
| e | SeriesPointEventArgs | Event details. |
OnPointClick(e)
Raises PointClick.
| Parameter | Type | Description |
|---|---|---|
| e | SeriesPointEventArgs | Event details. |
OnSliceClick(e)
Raises SliceClick.
| Parameter | Type | Description |
|---|---|---|
| e | SeriesPointEventArgs | Event details. |
OnStageClick(e)
Raises StageClick.
| Parameter | Type | Description |
|---|---|---|
| e | SeriesPointEventArgs | Event details. |
OnTooltipShowing(e)
Raises TooltipShowing.
| Parameter | Type | Description |
|---|---|---|
| e | ChartTooltipEventArgs | Event details. |
OnWebEvent(e)
Dispatches validated chart interaction notifications.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Client event. |
OnWebRender(config)
Sends fresh sample data and first-level presentation properties while preserving the client widget.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Client configuration. |
OnZoomChanged(e)
Raises ZoomChanged.
| Parameter | Type | Description |
|---|---|---|
| e | ChartZoomEventArgs | Event details. |
ResetZoom()
Resets the client viewport to the configured axis bounds.
Events
LegendItemClick
EventHandler<SeriesPointEventArgs> Occurs after a legend item toggles its series or categorical slice visibility.
PointClick
EventHandler<SeriesPointEventArgs> Occurs when a cartesian point or tile is activated.
SliceClick
EventHandler<SeriesPointEventArgs> Occurs when a pie, donut, or polar slice is activated.
StageClick
EventHandler<SeriesPointEventArgs> Occurs when a funnel stage is activated.
TooltipShowing
EventHandler<ChartTooltipEventArgs> Occurs when a new point tooltip is shown. Set Text or Cancel to replace or hide it.
ZoomChanged
EventHandler<ChartZoomEventArgs> Occurs after a user completes drag zoom or resets the viewport.
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IBindableComponent | Bindable components implement this interface. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |