InteractionOptions
Namespace: Wisej.Web.Ext.ChartJS4.Models
Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)
Represents the Chart.js interaction options (options.interaction) that control how hover and tooltip interactions select chart elements.
- C#
- VB.NET
public class InteractionOptions : OptionsBase
Public Class InteractionOptions
Inherits OptionsBase
An instance is available through Interaction.
Example:
var chart = new ChartJS4();
var interaction = chart.ChartOptions.Interaction;
interaction.Mode = "index";
interaction.Intersect = false;
interaction.Axis = "x";
Constructors
InteractionOptions()
Initializes a new instance of InteractionOptions.
Properties
Axis
String: Returns or sets which directions are used when calculating distances between the pointer and the elements (Chart.js option axis).
Value: "x", "y", "xy" or "r", or null (default) to use the Chart.js default ("x" for "index" mode, "xy" otherwise).
Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var interaction = chart.ChartOptions.Interaction;
interaction.Mode = "nearest";
interaction.Axis = "x";
IncludeInvisible
Boolean: Returns or sets whether points that are outside the chart area are also included when evaluating interactions (Chart.js option includeInvisible). (Default: False)
Value: true to include invisible points; otherwise false. The default is false.
Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var interaction = chart.ChartOptions.Interaction;
interaction.IncludeInvisible = true;
Intersect
Boolean: Returns or sets whether the interaction mode applies only when the mouse position intersects an item on the chart (Chart.js option intersect). (Default: True)
Value: true to require intersection; otherwise false. The default is true.
This value is always serialized. Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var interaction = chart.ChartOptions.Interaction;
interaction.Intersect = false;
Mode
String: Returns or sets which elements appear in the interaction (Chart.js option mode). (Default: null)
Value: One of "point", "nearest", "index", "dataset", "x" or "y", or null (default) to use the Chart.js default ("nearest").
"index" selects the items at the same index in all datasets; "dataset" selects all items of the same dataset; "point" selects all items that intersect the point; "nearest" selects the nearest items; "x" and "y" select the items that intersect along the respective axis. Changing this property refreshes the chart.
Example:
var chart = new ChartJS4();
var interaction = chart.ChartOptions.Interaction;
interaction.Mode = "index";
interaction.Intersect = false;
Methods
ResetAxis()
Resets the Axis property to its default value.
Sets Axis to null (Chart.js default). This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var chart = new ChartJS4();
var interaction = chart.ChartOptions.Interaction;
interaction.ResetAxis();
ResetExtensionData()
Resets the ExtensionData property to its default value.
Sets ExtensionData to null. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var chart = new ChartJS4();
var interaction = chart.ChartOptions.Interaction;
interaction.ResetExtensionData();
ResetIncludeInvisible()
Resets the IncludeInvisible property to its default value.
Sets IncludeInvisible to false. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var chart = new ChartJS4();
var interaction = chart.ChartOptions.Interaction;
interaction.ResetIncludeInvisible();
ResetIntersect()
Resets the Intersect property to its default value.
Sets Intersect to true. This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var chart = new ChartJS4();
var interaction = chart.ChartOptions.Interaction;
interaction.ResetIntersect();
ResetMode()
Resets the Mode property to its default value.
Sets Mode to null (Chart.js default). This method is used by the Visual Studio designer and the property grid ("Reset" command).
Example:
var chart = new ChartJS4();
var interaction = chart.ChartOptions.Interaction;
interaction.ResetMode();
ShouldSerializeAxis()
Returns whether the Axis property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if Axis is not null; otherwise false.
This method is used by the Visual Studio designer and the property grid to determine whether the property value is persisted in the generated code.
Example:
if (interaction.ShouldSerializeAxis())
interaction.ResetAxis();
ShouldSerializeExtensionData()
Returns whether the ExtensionData property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if ExtensionData contains at least one entry; otherwise false.
This method is used by the Visual Studio designer and the property grid to determine whether the property value is persisted in the generated code.
Example:
if (interaction.ShouldSerializeExtensionData())
interaction.ResetExtensionData();
ShouldSerializeIncludeInvisible()
Returns whether the IncludeInvisible property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if IncludeInvisible is true; otherwise false.
This method is used by the Visual Studio designer and the property grid to determine whether the property value is persisted in the generated code.
Example:
if (interaction.ShouldSerializeIncludeInvisible())
interaction.ResetIncludeInvisible();
ShouldSerializeIntersect()
Returns whether the Intersect property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if Intersect is false; otherwise false.
This method is used by the Visual Studio designer and the property grid to determine whether the property value is persisted in the generated code.
Example:
if (interaction.ShouldSerializeIntersect())
interaction.ResetIntersect();
ShouldSerializeMode()
Returns whether the Mode property has been changed from its default value and should be serialized by the designer.
Returns: Boolean. true if Mode is not null; otherwise false.
This method is used by the Visual Studio designer and the property grid to determine whether the property value is persisted in the generated code.
Example:
if (interaction.ShouldSerializeMode())
interaction.ResetMode();