[vtkusers] Positioning a text label in a vtkChartXY

Mario Rodriguez biomates at telefonica.net
Tue Jan 5 15:44:10 EST 2016


Hello,

I want to write a text label and place it in a position given in the 
vtkChartXY coordinates system.

My environment:  VTK 6.3 + TCL.

This is what I have made so far:

I have a chart created by

vtkChartXY chart

with some points in it. Now I create a text label this way:

vtkTextMapper mapText
     mapText SetInput "Some text here"
vtkActor2D txt
   txt SetMapper mapText

Then, I create the renderer:

vtkRenderer renderer

and add to it the chart and the text:

renderer AddActor txt
txt SetPosition 100 100

And I see the complete scene as expected.

My problem is that I need to set the label position according to the 
coordinates system of vtkChartXY, not in Viewport coordinates. Is it 
possible?

I have seen that vtkXYPlotActor has some methods to get these 
coordinates, but I couldn't find anything similar in vtkChartXY.

Thanks.

--
Mario




More information about the vtkusers mailing list