[vtkusers] Positioning titles within vtkAxis
Frese Daniel Dr.
frese at heidenhain.de
Tue Dec 7 08:29:50 EST 2010
Hello Eric, Marcus,
before I explain my problem once more I just want to add that I find the charts functionality already quite useful.
As I said I just updated my vtk stuff and I can imagine it must have been quite some work to get to this point.
I appended a screenshot illustrating the problem. Since I don't know how this appears on the mail list I just describe briefly.
I have a scene with a vtkImageItem to show some 2D matrix data. Around the image I have axes (vtkAxis objects) with
appropriate ticks, tick labels and axes titles. The problem is that the axes titles overlap with the tick labels. E.g. for the
case of the X axis , the title should be lower such that it does not touch the labels, but there does not seem to
be a way to do that as of now.
A possible low level solution would be a way to specify some vertical (horizontal axis case) or some horizontal (vertical axis case) offset
for the position of the titles (in pixel or font size units).
In principle of course the vtkAxis object could calculate such an offset by itself, since it has access to both
the labels' and the titles' text properties.
What do you think ?
Daniel
Von: Eric E. Monson [mailto:emonson at cs.duke.edu]
Gesendet: Dienstag, 7. Dezember 2010 13:54
An: Frese Daniel Dr.
Cc: vtkusers at vtk.org
Betreff: Re: [vtkusers] Positioning titles within vtkAxis
Hey Daniel,
It does seem like SetLineOffset should do something like what you want, but I think they way the label text is applied with VerticalJustification probably nullifies any line offset setting. Line spacing shouldn't matter for a single line of text.
So, the adjustments you want are just not implemented. Marcus, the developer, has worked hard to get the labels right, though, so if you have a use case where the labels are running into the axis ticks maybe you should describe the situation and send a screen shot - it may be something that needs fixing.
You're right that the charts are still under development, but some of the core functionality has settled down, and as you said, the current implementation is better than the 5.6.1 version.
-Eric
------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group
On Dec 7, 2010, at 3:35 AM, Frese Daniel Dr. wrote:
Hi all,
I have a problem positioning an axis title relative to its vtkAxis object.
Basically, if I draw a horizontal X-axis, the assigned title is written such that it overlapps with the
tick labels. Reading through the docs, I got the impression that I should be able to introduce a
vertical offset between the drawn axis and the titel by using either a call to
Xaxis->GetTitleProperties()->SetLineOffset(offset_in_pixel)
or by
Xaxis->GetTitleProperties()->SetLineSpacing(scale_factor).
But neither call seems to have any effect.
Moving from 5.6.1 to the latest vtk git source tree I noticed that the chart stuff seems to have
improved greatly (most functions a joy to use !), but it still seems to be a work in progress.
So am doing something stupid and do I miss something here or is this feature just not
implemented yet ?
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101207/3eae850f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot.jpg
Type: image/jpeg
Size: 28070 bytes
Desc: screenshot.jpg
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101207/3eae850f/attachment.jpg>
-------------- next part --------------
</PRE><p>
------------------------------------------------------------------------------------------------------ <br>
Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut <br>
Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard <br>
Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),<br>
Michael Grimm, Matthias Fauser, Sebastian Tondorf<br><br>
<a href="http://www.heidenhain.de/disclaimer" target="_blank">E-Mail Haftungsausschluss / E-Mail Disclaimer</a><br><pre>
More information about the vtkusers
mailing list