[vtkusers] How to get information of Tooltip of vtkChartXY

Eric E. Monson emonson at cs.duke.edu
Mon Feb 7 12:29:40 EST 2011


Maybe the more useful patch would be to add a GetTooltip() method to vtkChartXY since then you could just grab the text from the tooltip with GetText(). "TooltipInfo" isn't really a well-defined notion since there is just a bunch of potentially useful information which gets passed to SetTooltipInfo() and then whomever overrides this method just uses whichever pieces of it they need.

-Eric

On Feb 7, 2011, at 12:10 PM, shantanu choudhary wrote:

> On Mon, Feb 7, 2011 at 8:31 PM, Eric E. Monson <emonson at cs.duke.edu> wrote:
> Hello all,
>> 
> Thank you Eric for such a prompt reply.
>> 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.
> Okay, I was thinking that somehow I would be able to avoid it. I will
> give it a try. We can have a simple, GetTooltipinfo too. I can submit
> a patch wrt that, if it appears useful to others too.
> 
> -- 
> Regards
> Shantanu Choudhary




More information about the vtkusers mailing list