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

Message ListMessage List     Post MessagePost Message

  Centering xyline
Posted by Maurice on Jan-21-2014 01:07
Is it possible to have a padding around the x and y border.  I would like to be able to plot lines and symbols in the middle of my chart.

Problem is if I display custom symbol and symbol is on the border, image is cut off.  And has well the line may occupy the x or y border.

thank you

  Re: Centering xyline
Posted by Peter Kwan on Jan-21-2014 03:00
Hi Maurice,

Yes. There are two methods:


(a) Axis.setMargin

This method can be used to set up a non scaling margin on both ends of an axis. For
example:

c->yAxis()->setMargin(10, 10);
c->xAxis()->setMargin(10, 10);

The non-scaling margin will appear as an empty region at the ends of the axis.

For the purpose of avoid the symbol, the margin can be set to half the symbol size.


(b) If the axis is auto-scaled, you may use Axis.setAutoScale to configure the scaling
margin. ChartDirector will then try to extend the axis scale so that at least a certain
percentage of the axis is outside the data range. For example:

//10% scale extension on both ends of the axis
c->yAxis()->setAutoScale(0.1, 0.1, 0);


Hope this can help.

Regards
Peter Kwan