Question

I could not find a way to get vertical labels in a Roassal visualization. Is there a way? Or a general way to rotate elements?

Vertical Labels

Was it helpful?

Solution

The new version, Roassal2, does supports rotated labels. In the case of the example above, now you can do:

| view |
view := RTView new.
-15 to: 10 do: [ :i |
    view add: ((RTRotatedLabel new angleInDegree: -90) elementOn: 'hello world').
].
RTHorizontalLineLayout on: view elements.
view open

You will get:

enter image description here

Another example:

| v shape |
v := RTView new.
shape := RTRotatedLabel new.
shape angleInDegree: [ :cls | cls numberOfMethods negated / 1.5 ].
shape text: [ :cls | ' ', cls name ].
shape color: (Color black alpha: 0.2).
v addAll: (shape elementsOn: Collection withAllSubclasses).

v canvas color: Color white.
v open

You will have:

enter image description here

I hope it helps :-)

OTHER TIPS

Currently, Roassal does not support such a feature. However you can get something close to.

| view |
view := ROView new.
-15 to: 10 do: [ :i |
    view add: ((ROLabel verticalText interlineSpace: i) elementOn: 'hello world').
].
ROHorizontalLineLayout on: view elements.
view open

In Roassal 1.422

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top