[vtkusers] How to get information of Tooltip of vtkChartXY

Eric E. Monson emonson at cs.duke.edu
Mon Feb 7 10:01:00 EST 2011


Hello Shantanu,

Right now I think the only way to access this information is to subclass vtkChartXY and override SetTooltipInfo to feed the information to another class. The coordinates displayed are never stored internally to the ChartXY, they are only stored in the vtkTooltipItem as text. Of course, in your chart subclass you could store the most recent coordinates in the SetTooltipInfo method and add get/set methods for those variables. You can also subclass vtkTooltipItem and then in your chart subclass set this new type as the the chart's tooltip, and internally you can do whatever you want with the information that's been passed to it from the chart during the hover. 

Probably not the easy solution you were hoping for, but I think that's what's required with the current setup.

Talk to you later,
-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Feb 7, 2011, at 9:21 AM, shantanu choudhary wrote:

> Hello all,
> 
> I am working on a Qt+vtk application. I am using vtkChartXY, plotting
> data and everything is working fine. Now I want to access Tooltip
> information, to get/extract coordinates(of graph) shown when we hover
> our mouse over the curve. I see the class having vtkTooltipItem as
> protected, and there is a function to SetTooltipInfo, but no
> GetTooltipInfo. Is there any other way or standard way to access this
> value apart from inheriting vtkChartXY class and accessing this
> protected value? I have tried using QWidget->toolTip but without
> success.
> 
> -- 
> Regards
> Shantanu Choudhary
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list