ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  TextBox with background rotation
Posted by Patrick on Jun-04-2015 10:46
Attachments:
I was wondering if there is a way to rotate a textbox that has a rounded corner
background.

Here's the code I use to produce the chart named "4styleMulti-90.png":

Dim t As ChartDirector.TextBox = c.addText(xPos, yPos, partNames(i), "Arial", 8,
&H2C2C2C, Chart.Left, 90, False)
t.setPos(t.getLeftX() - (t.getWidth() / 2), t.getTopY() - 10) ' - (t.getHeight() / 2))
t.setBackground(&H80FFFFFF, &H80FFFFFF)
t.setRoundedCorners(5, -1, -1, -1)

This looks great, and works just fine, but some of the names overlap and are hard to read.
I was going to see how it looked with changing the textbox angle from 90 to 45. I thought
the background that is just a little larger than the text size would rotate also, but it
doesn't.

See the file named "4styleMulti-45.png" - the background stretches to fit the text at the
angle, instead of the background rotating with the text.

What I would like is the tight background behind the names, but rotated at 45 degrees.

Is that possible?

Thanks!
4styleMulti-90.png
4styleMulti-90.png

89.42 Kb
4styleMulti-45.png
4styleMulti-45.png

108.43 Kb

  Re: TextBox with background rotation
Posted by Peter Kwan on Jun-05-2015 01:21
Hi Patrick,

The angle in addText only change the text angle inside the box, but not the box itself. For
your case, there is a method using CDML, but it does not have rounded corners. It is like:

Dim t As ChartDirector.TextBox = c.addText(xPos, yPos, "
<*block,bgcolor=80FFFFFF,angle=45,margin=3*>" & partNames(i) & "<*/*>", "Arial", 8,
&H2C2C2C, Chart.Left, 90, False)

Hope this can help.

Regards
Peter Kwan

  Re: TextBox with background rotation
Posted by Patrick on Jun-05-2015 02:04
Attachments:
Thank you. Worked great. See attachment.
4styleMulti-new.png
4styleMulti-new.png

106.17 Kb