Move the mouse over the graph to show the value and move the mouse over the Graph

Source: Internet
Author: User

Move the mouse over the graph to show the value and move the mouse over the Graph
After the line chart report is completed, the product manager asks to remove the value on the line chart and show the value when the mouse goes through the line chart. The implementation method is as follows:This method is applicable to the charting line chart report under dotnetcharting.Implementation idea: Add a lable label on the form to obtain the x-axis, Y-axis, and mouse coordinate values of the point when the mouse goes through the line point. Label the coordinates of lable as the coordinates of the mouse, assign values to lable, and display lable. /// <Summary> /// move the mouse over the graph to display the value /// </summary> /// <param name = "sender"> </param> /// <param name = "e"> </param> private void chart4_MouseMove (object sender, mouseEventArgs e) {var chart = sender as Chart; if (chart! = Null) {HitTestInfo hit = chart. HitTest (e. X, e. Y); var o = hit. Object as Element; if (o! = Null) {var yvaule = o. YValue; label2.Visible = true; // label2.Text = yvaule is displayed when the cursor passes. toString (CultureInfo. invariantCulture); label2.Location = new Point (e. x, e. y-20);} When else // lable hides {label2.Visible = false; }}} line charts and other reports when the mouse leaves. For more information, see dotnetcharting.


How can I draw a curve using the chart control that comes with vs2010 c # Show the coordinates of the point in the coordinate system when I move the cursor over the curve?

Private void chart1_MouseMove (object sender, MouseEventArgs e) {// This is the coordinate of the control where the mouse is located. You can convert label1.Text = e with your coordinate system. x. toString (); label3.Text = e. y. toString ();}

In Labview, how does one obtain the current value of the waveform curve? That is, the coordinates pointed by the mouse can be displayed.

You must use a cursor to implement this. Other methods do not seem to work! You can create a single curve cursor, move the cursor to the current point of the curve, you can see the current value in the cursor toolbar.
If you want to make an automatic prompt like a TIP, it is difficult to implement it. I have asked NI engineers to create only one text box, controls the display, hide, and movement of text boxes to implement functions similar to TIP!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.