Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net
 QCChart3D 3D Charting Tools for .Net (VB and C#)
 Getting Data on mouse click
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

victorvikas

6 Posts

Posted - 18 Apr 2007 :  02:19:59  Show Profile  Reply with Quote
Hi

Once the chart is plotted , how can I get the the data(X,Y,Z axis values and their titles) of the point of click of mouse such that i can store it in some other variables and manipulate them as required??

Thanks & Regards
Vikas.

quinncurtis

1586 Posts

Posted - 18 Apr 2007 :  11:03:09  Show Profile  Reply with Quote
We are not sure what you mean by "get the the data(X,Y,Z axis values and their titles). Are you talking about clicking on an axis object, and retrieving some values, or are you talking about clicking on a data point and retrieving some values?

You can retrieve the values of data points by deriving a new class from our DataToolTip class, overriding the OnMouseUp method, where you can get the data point. See the other examples in the MouseListeners example program.

		// Custom data tooltip class
class CustomToolTip: DataToolTip 
{ 
  public CustomToolTip(LinePlot3D component): base (component) 
  {
  }

  public override void OnMouseUp (MouseEventArgs mouseevent)
  {
    // get data about nearest point
    NearestPointData npd = GetNearestPoint();
    if (npd != null)
    {
      int selectedindex = npd.NearestPointIndex;
      Point3D p3d = npd.NearestPoint;
      System.Console.Out.Write("X = " + p3d.X.ToString() + " ");
      System.Console.Out.Write("Y = " + p3d.Y.ToString() + " ");
      System.Console.Out.Write("Z = " + p3d.Z.ToString() + " ");
      System.Console.Out.WriteLine();
    }
  }
}

.
.
.
.
// In the main graph building routine
CustomToolTip datatooltip = new CustomToolTip(this);
datatooltip.SetDataToolTipFormat(ChartObj.DATA_TOOLTIP_CUSTOM);
datatooltip.SetEnable(true);
chartVu.AddMouseListener(datatooltip);  


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07