We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

HitRadius around Lines, not Points

Hi,

I have written a diagramm, where the user can click the Lines to select a series. We talk about a series from typ Line.

The Problem is: if the user wants to select the line, he has to move the mouse at the concrete Position (+-0 px).

Is there a way to enter some kind of hit radius like that around points but for lines?

Kind regards
T. Goroll


4 Replies

FS Fathima Shalini P Syncfusion Team November 12, 2007 11:46 AM UTC


Hi Goroll,

Thanks for your interest in Syncfusion Products.

Please do find the sample in the following link.

http://websamples.syncfusion.com/samples/Chart.Windows/HitTestRadius/main.htm

I have just added 2 data points for a Line Chart. I have used HitTestRadius property. Please do find this in the following code snippet.

series.Points.Add(1, 10);
series.Points.Add(2, 30);
series.Style.HitTestRadius = 50;

• When you right click close to the line you could see the context menu with only Series Type option.

• If you right click on some other area you could see context menu with some more options like Series, Mode etc.

We can increase the bounds by setting larger values for the HitTestRadius property as follows.

series.Style.HitTestRadius = 125;

I believe that provided details will help you with this regard and please let me know if you have any more queries regarding.

Regards,
Fathima Shalini.P




TG Torsten Goroll November 12, 2007 01:07 PM UTC

Hi Fathima,

the hit radius is a good property to make it easier to the user, to select points. But what I'm looking for, is a mechanism to make it easier for the user to select lines.

I hope that describes the problem better.

Kind regards

Torsten



FS Fathima Shalini P Syncfusion Team November 14, 2007 01:12 PM UTC

Hi Torsten,

Essential Chart does not support any built in function to select a series in Line Chart at run time and also to adjust the hit distance based on the line reference. We can achieve the selection look by adding custom points at the ends of the lines in the series. Please refer the below sample that shows how to display custom points to highlight when you click a particular line in ChartArea.

http://websamples.syncfusion.com/samples/Chart.Windows/F69731_1/main.htm

Please try this and let me know if this helps.

Regards,
Fathima




TG Torsten Goroll November 14, 2007 03:26 PM UTC

Hi,

I've solved it through a trick. I'm highlighting the line when it is clickable, so the user becomes a feeling when he can click.

The soulution with the helper points is a dirty hack, don't you think?

Thanks for your help,
Torsten


Loader.
Live Chat Icon For mobile
Up arrow icon