How to select an entire line on the chart?


Author
Message
Fernando Albino
Fernando Albino
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)
Group: Forum Members
Posts: 2, Visits: 10
Hello,

I would be like to select an especific line (by clicking), for then clone this.

Can anyone help me?

Fernando
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Fernando,

You can easily perform a hit test using the following code:

void nChartControl1_MouseMove(object sender, MouseEventArgs e)
{
NHitTestResult result = nChartControl1.HitTest(e.X, e.Y);

    if (result.Series as NLineSeries != null)
    {
      // result.Series holds a reference to the clicked line;
    }
}

The All Examples\Interactivity\Mouse Events group of examples show how to perform hit testing in general. Just let us know if you have any questions...

Best Regards,
Nevron Support Team


Fernando Albino
Fernando Albino
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)
Group: Forum Members
Posts: 2, Visits: 10
Excellent, thank you!

I need help for something else...

The selected line need to move to the right or left (then modify X axis values to do this(?), im using NNumericUpDown)
I have a fix milliseconds List<DateTime> to create X axis, loaded from some file. who can I modify this to can be able to move right or left my line? It's possible to expand X axis after created?

Thank you!
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Fernando,

Can you elaborate a bit on what you want to accomplish - if is it simply to shift the X values of the line then you just need to iterate over the data points in the line and add / subtract a fixed amount in order to move the line...


Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic
1 active, 1 guest, 0 members, 0 anonymous
No members currently viewing this topic!

Login

Explore
Messages
Mentions
Search