Skip to main content

ChartView

Wisej.NET 4.2.0+

A column series and a line series on a secondary axis, a target line, and the shared tooltip over May.

The ChartView control draws business charts directly in Wisej.NET, without an extension or a JavaScript charting library to configure. A chart is a collection of ChartSeries objects, and every series picks its own geometry, so revenue can be drawn as columns while order counts run as a line across the same months. The control paints itself as SVG with the colors of the current theme, so it follows light and dark mode the same way the rest of the application does.

Reach for ChartView when a dashboard, a report screen or a detail form needs a full chart with axes, a legend and tooltips. For a trend squeezed into a table cell or a card, use the Sparkline; for a single capacity value, use the RadialGauge or the MeterBar; for a metric card with a headline number, use the KpiPanel.

info

For a complete list of properties, methods, and events, see the API documentation.

Features​

Series and Chart Types​

Every series sets its ChartType. Cartesian types (Line, Area, Column, Bar, StackedColumn, Stacked100, Scatter, Bubble, Waterfall, Candlestick, RangeArea) share the chart's axes and can be mixed in one chart. Pie, Donut, PolarArea, Radar, Funnel, Treemap and Heatmap lay out their own geometry and draw no axes.

A series carries the options that belong to its type: Smooth and Markers for lines, Fill and FillOpacity for areas and radar shapes, InnerRadius and CenterText for a donut, RunningTotal and Connectors for a waterfall, UpTone and DownTone for gains, losses and candles, Neck and ShowConversion for a funnel, Levels for a heatmap. Options that do not apply to the series' type are ignored.

Data Binding​

A series reads its samples from one of three places, in this order: its own DataSource, the chart's shared DataSource, or its unbound Points collection. When the data comes from a source, the *Member properties name the fields to read: CategoryMember and ValueMember for most charts, XMember and YMember for scatter plots, SizeMember for bubbles and treemaps, LowMember, HighMember, OpenMember and CloseMember for ranges and candles, ColorMember for treemap tiles and TotalMember for waterfall totals. A member path can be dotted, for example Customer.Region.

Each bound sample keeps the record it came from in ChartPoint.Tag, on the server only, so a click handler gets the original object back without a lookup.

Axes and Annotations​

XAxis, YAxis and Y2Axis are ChartAxis objects with a Title, a tick Format (a .NET numeric format such as "C0" or "N1"), Gridlines, LabelRotation, and optional Min and Max bounds; leaving the bounds null scales the axis to the data. A series with SecondaryAxis = true is plotted against Y2Axis.

Annotations adds reference lines and bands to the plot. A ChartAnnotation with only a Value draws a line; one with an EndValue as well draws a band between the two. Axis picks the coordinate system (X, Y or Y2), Text labels it and Tone colors it. Annotations are drawn on charts that have axes.

Legend, Tooltips and Zoom​

The legend is interactive: clicking an item hides or shows its series (or the slice, on a pie) and updates ChartSeries.Visible on the server. Legend places it at the Top, Right or Bottom, or hides it.

Tooltip selects a tooltip for one point (Single), one listing every series at the hovered position (Shared), or none. Crosshair adds a guide line at the hovered coordinate. With ZoomMode set to X, Y or Both, the user can drag a rectangle to zoom; a double-click, the Escape key or a call to ResetZoom() restores the configured bounds.

The chart is keyboard accessible: the arrow keys move between points and Enter activates the focused one, which raises the same events as a click.

Events​

EventRaised when
PointClickA point, column or tile of a cartesian series is activated.
SliceClickA pie, donut or polar slice is activated.
StageClickA funnel stage is activated.
LegendItemClickA legend item has toggled its series or slice.
TooltipShowingA point tooltip is about to show; the handler can replace its text or cancel it.
ZoomChangedThe user completed a drag zoom or reset it.

The first four carry a SeriesPointEventArgs with the Series, its SeriesIndex, the PointIndex (-1 for a legend item) and the Point.

Appearance​

Without further settings each series takes the next color of the theme's chart palette. Tone gives a series a semantic color instead (Primary, Success, Warning, Danger, Neutral), and Color an explicit one. At the chart level, Palette replaces the color sequence with explicit colors and TonePalette with semantic tones. Title adds a heading above the plot, Animated fades updates in, and EmptyState sets the message shown while no series has samples.

How To​

Bind a Chart to a List​

Give the chart a shared data source and add one series per value to plot. Here revenue is drawn as columns and the order count as a line on the secondary axis.

public class MonthlySales
{
public string Month { get; set; }
public decimal Revenue { get; set; }
public int Orders { get; set; }
}

this.chartView1.Title = "Revenue and orders, H1";
this.chartView1.DataSource = salesService.GetMonthlySales(2026); // List<MonthlySales>

this.chartView1.Series.Add(new ChartSeries {
Name = "Revenue", ChartType = ChartType.Column,
CategoryMember = "Month", ValueMember = "Revenue" });

this.chartView1.Series.Add(new ChartSeries {
Name = "Orders", ChartType = ChartType.Line, Tone = ChartTone.Success,
CategoryMember = "Month", ValueMember = "Orders",
SecondaryAxis = true, Markers = ChartMarkers.Always });

this.chartView1.YAxis.Format = "C0";
this.chartView1.Y2Axis.Title = "Orders";
this.chartView1.Tooltip = ChartTooltip.Shared;

The chart reads the source when it renders. After changing the records in place, call Update() to send the new samples.

Build a Donut from Unbound Points​

Without a data source, a series draws the ChartPoint objects in its Points collection.

var tickets = new ChartSeries {
Name = "Open tickets", ChartType = ChartType.Donut,
InnerRadius = 0.6, CenterText = "128 open", ExplodeOnClick = true };

tickets.Points.Add(new ChartPoint { Category = "New", Value = 42 });
tickets.Points.Add(new ChartPoint { Category = "In progress", Value = 51 });
tickets.Points.Add(new ChartPoint { Category = "Waiting on customer", Value = 23 });
tickets.Points.Add(new ChartPoint { Category = "Escalated", Value = 12 });

this.chartView1.Legend = ChartLegend.Right;
this.chartView1.Series.Add(tickets);

Mark a Target and a Tolerance Band​

this.chartView1.Annotations.Add(new ChartAnnotation {
Axis = ChartAnnotationAxis.Y, Value = 55000,
Text = "Target", Tone = ChartTone.Warning });

this.chartView1.Annotations.Add(new ChartAnnotation {
Axis = ChartAnnotationAxis.Y, Value = 40000, EndValue = 45000,
Text = "Break-even", Tone = ChartTone.Neutral });

Drill Down from a Point​

ChartPoint.Tag holds the bound record, so the handler can open the detail it belongs to. TooltipShowing can replace the tooltip with text composed on the server.

private void chartView1_PointClick(object sender, SeriesPointEventArgs e)
{
var month = (MonthlySales)e.Point.Tag;
new MonthlyOrdersDialog(month.Month).ShowDialog();
}

private void chartView1_TooltipShowing(object sender, ChartTooltipEventArgs e)
{
var month = (MonthlySales)e.Point.Tag;
e.Text = $"{month.Month}: {month.Orders} orders, {month.Revenue:C0}";
}

Zoom and Export​

this.chartView1.ZoomMode = ChartZoomMode.X;
this.chartView1.ZoomChanged += (s, e) =>
this.labelRange.Text = e.XMin == null ? "Full range" : $"{e.XMin:N0} – {e.XMax:N0}";

// Downloads the chart as the user sees it, zoom and hidden series included.
this.chartView1.ExportImage(ChartImageFormat.Png, "revenue-h1");

ExportImage runs in the browser, so it works once the chart has been shown.

Advanced​

JavaScript Widget​

ItemDescription
Class name"wisej.web.ChartView"
Theme appearance"chartview", see Themes. The appearance supplies the grid, label, text and background colors.
Child components"chart" is the HTML host of the rendered SVG. See JavaScript.