Skip to main content

LineOptions

Namespace: Wisej.Web.Ext.ChartJS

Assembly: Wisej.Web.Ext.ChartJS (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.chartJS1.ChartType = ChartType.Line;

var options = (LineOptions)this.chartJS1.Options;
options.ShowLines = true;
options.Title.Text = "Visitors per Day";

Constructors​

Instance member LineOptions()​

Default constructor.

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

Example:

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

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

Instance member LineOptions(chart, defaults)​

Constructs a new instance of the LineOptions set.

NameTypeDescription
chartChartJSThe ChartJS 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 Title, Legend or Tooltips) are copied into the new instance, which is how the chart preserves the common settings when ChartType changes. The ChartJS 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.chartJS1, this.chartJS1.Options);
options.ShowLines = false;
this.chartJS1.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 Chart.js showLines option. Set it to false to display only the data points.

Example:

// show only the points of the line chart.
var options = (LineOptions)this.chartJS1.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. The stacking of each axis can also be set using Stacked on the axes in Scales.

Example:

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