Skip to main content

ChartValue

Namespace: Wisej.Web.Ext.ChartJS4.Models

Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)

Provides special Chart.js data point sentinel values for use in dataset Data arrays.

public static class ChartValue

JSON has no representation for NaN, so the sentinel values are serialized as special strings that the client-side script converts back to the corresponding JavaScript value before passing the data to Chart.js.

Example:

chart.DataSets.Add(new LineDataSet
{
Label = "Readings",
Data = new object[] { 10, 12, ChartValue.NaN, 15, 11 }
});

Fields​

NameTypeDescriptionValue
NaNChartNaNRepresents a skipped (NaN) data point. When used in a dataset's Data array, it serializes to JavaScript NaN, causing Chart.js to mark the point as skipped (ctx.p0.skip / ctx.p1.skip = true). This enables per-segment styling via the segment dataset option.