Draw vertical text

M

marss

The text for the chart Y-axis title is to be drawn vertically. Here is
the snippet of my code.
.....
StringFormat drawFormat = new StringFormat();
drawFormat.FormatFlags = StringFormatFlags.DirectionVertical ;

//g is object of type System.Drawing.Graphics
g.DrawString("Period", font, Brushes.Black, 10, 10, drawFormat);
.....
Standard functionality allows to do that but the text is drawn from the
top to the bottom whereas I need the text to be drawn from the bottom
to the top (as it is more usual for users). How can I do it?
 
G

Greg Collins [InfoPath MVP]

There might be a way to do it, but I wonder if you are accomplishing with your code the same thing that can be accomplished using CSS:

<div style="writing-mode: tb-rl;">This is a test</div>

This type of vertical text is for foreign language support and is not a complete vertical text feature.
 
M

marss

Greg said:
There might be a way to do it, but I wonder if you are accomplishing with your code the same thing that can be accomplished using CSS:

<div style="writing-mode: tb-rl;">This is a test</div>

This type of vertical text is for foreign language support and is not a complete vertical text feature.

Thanks for help. It is interesting and usefull feature of CSS I don't
know before.
Solution of my problem was prompted in another group yet. It can be
resolved with rotating X and Y axis before drawing (methods
TranslateTransform and RotateTransform of System.Drawing.Graphics
object).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top