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!