ChartDirector: YAxisTitle Wrapping

If I have a multiline XAxis title from either by wrapping by setting Textbox.setMaxWidth or embedding EOLs the resulting lines are centered as one would expect…

But for YAxis titles, the resulting lines are top aligned ( that would be hight if it was horizontal instead of vertical)… and that looks horrible

if I try to use TextBox.SetAlignment = kCentered to fix it, the text is centered in the textbox BUT the TextBox as whole is centered over the Yaxis both horizontally an vertically (so obscures some Yaxis lables and winds up half in the plot area) instead of to the left of the Axis labels…
What seems to be missing is a a way to align the text separately from the box.

Is there any workaround?

And Is this behavior (top aligned Y Axis label lines) expected (I hope not!) , a bug in ChartDirector or a bug in the MBS Plugin?

Thanks,

  • Karen

Did you try to embed formatting commands in texT?

http://www.monkeybreadsoftware.net/faq-chartdirectormarkuplanguage.shtml

I can try it …

But I am trying to write some code to make CD easier for me to use. Doing this via CDML for a general case would be more work than I was hoping for!

I would MUCH rather just have the alignment behave how it should by default when the YAxis Title wraps.i know the current behavior could not have been intended!

So is it a bug in the plugin or ChartDirector itself?

If in the Plugin then you can fix it… If not then workarounds,no matter how ugly, are the only option.

  • Karen

did you try 8 for alignment (top center)?

see
http://www.monkeybreadsoftware.net/faq-chartdirectoralignmentspecification.shtml

Yes. That puts it horizontally (instead of Vertically) over the top of the Y axis centered over the YAxis in the X direction

I tried all the alignment settings I could think of but none worked for placing a wrapped Y axis title with the lines centered vertically along the YAxis as expected

Very frustrating

maybe you email me little sample project and show me the problem?

On it’s way

  • Karen

the only way I found so far is this:

  Dim yTitle as CDTextBoxMBS = c.yAxis.setTitle("<*block,halign=center*>Some physical proprerty label (units)<*/*>" , "arialbi.ttf", 12)
  

That does work, even if not obvious to someone starting out with the product.

Not centering by default when multi-line for teh Yaxis title is obviously a ChartDirector bug… We will have to wait and see if they address it now that it has been reported.

  • Karen