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

Message ListMessage List     Post MessagePost Message

  x-axis scale legend is over the boundary
Posted by Cj Talas on Nov-04-2011 20:08
Attachments:
Hi Peter,

Just a quick question.

What i am doing here is trying to make the x-axis legends look bigger. But the problem is it gets cut off, or it goes beyond the border.

Is there a way for me to move the last legend a little bit to the left so that it wont get cut off.


Thank you for your time.
Also the regarding the chart border is it possible to remove the borders (top, left, right) and just have the bottom border retained?

Thanks you in advance.
q2.PNG

  Re: x-axis scale legend is over the boundary
Posted by Peter Kwan on Nov-05-2011 01:38
Hi Cj Talas,

The easiest way to avoid cutoff is to leave some margin between the right side of the plot area and the right edge of the chart. As the cutoff is also possible for the left label, a left margin may be useful too.

If you really want to move the label, you may try the following approach:

(a) After entering all the data to the chart, call BaseChart.layout to layout the chart and auto-scales the axes.

(b) Use Axis.getTicks to get the position of all labels on the x-axis. Check if the last label is too close to the right edge. (You may use XYChart.getXCoor to determine the x-pixel coordinate using the x-data coordinate.)

(c) If the label is too close to the right edge and needs to be moved, you may use Axis.getLabel to get the original label, append some empty space to the end of the label to make a longer label, and then use Axis.addLabel to add the label back. The empty space will "push" the original text to the left.

You may want to perform similar steps for the leftmost label.

Hope this can help.

Regards
Peter Kwan

  Re: x-axis scale legend is over the boundary
Posted by Cj Talas on Nov-08-2011 17:49
Thanks Peter,

I will try your suggestion....

Cheers.