Skip to main content

LineOptions

Namespace: Wisej.Web.Ext.ChartJS3

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

Options for the Line chart.

public class LineOptions : Options

The Options property returns an instance of this class when ChartType is Line.

Example:

this.chartJS31.ChartType = ChartType.Line;

var options = (LineOptions)this.chartJS31.Options;
options.ShowLines = true;
options.Plugins.Title.Text = "Temperatures";

Constructors​

Instance member LineOptions()​

Default constructor.

Creates a standalone LineOptions set that is not yet attached to a ChartJS3 control. Assign it to the Options property of a line chart.

Example:

var options = new LineOptions();
options.Plugins.Title.Text = "Measurements";

this.chartJS31.ChartType = ChartType.Line;
this.chartJS31.Options = options;

Instance member LineOptions(chart, defaults)​

Constructs a new instance of the LineOptions set.

NameTypeDescription
chartChartJS3The ChartJS3 that owns this set of options.
defaultsOptionsDefault options to copy from. Can be null.

When defaults is not null, the properties shared with it (for example Plugins, Scales or IndexAxis) are copied into the new instance, which is how the chart preserves the common settings when ChartType changes. Nested option sets are copied into new instances, other properties are copied only when they have a non-default value. The ChartJS3 control creates this instance automatically when ChartType is Line.

Example:

// create a new set of line options preserving the current shared options.
var options = new LineOptions(this.chartJS31, this.chartJS31.Options);
options.ShowLines = false;
this.chartJS31.Options = options;

Properties​

Instance member ShowLines​

Boolean: Returns or sets whether the lines between points are drawn. If false, the lines between points are not drawn. (Default: True)

Value: true to draw the lines between the points; otherwise, false. The default is true.

Serialized as the top level showLines option of the chart. Changing the value calls Update.

Example:

// show only the points of the line chart.
var options = (LineOptions)this.chartJS31.Options;
options.ShowLines = false;

Instance member Stacked​

Boolean: Returns or sets whether the lines stack on top of each other along the y axis. (Default: False)

Value: true to stack the lines; otherwise, false. The default is false.

Serialized as the top level stacked option of the chart. In Chart.js 3 stacking is configured on the axes, use Stacked on the axes in Scales to stack the lines. Changing the value calls Update.

Example:

var options = (LineOptions)this.chartJS31.Options;
options.Stacked = true;
options.Scales.yAxes[0].Stacked = true;