I am using Chart.js with Blazor I have a simple line chart everything works but when i click on the chart I would like to mark the nearest point automatically.
I created the config as anonymous type, I have tried different interaction modes no success yet.
var config = new
{
Type = Type.ToString().ToLower(),
Options = new
{
Legend = new
{
Display = false,
},
BezierCurve = false,
Responsive = true,
Interaction = new
{
Intersect = false,
},
Scales = new
{
YAxes = new[]
{
new
{
Position = "left",
Ticks = new
{
SuggestedMin = SuggestedMin
}
}
},
XAxes = new[]
{
new
{
Ticks = new
{
BeginAtZero = true,
AutoSkip = true,
MaxTicksLimit = 4
}
}
}
}
},
Data = new
{
Datasets = new[]
{
new
{
Fill = false,
LineTension= 0,
Data = Data,
BackgroundColor = "#FFFFFF",
}
},
Labels = Labels
}
};