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

Message ListMessage List     Post MessagePost Message

  The chart ignores AggregateLabel
Posted by Peter S on Dec-01-2017 20:03
Attachments:
Hello,

i have a chart that is showing the columns and on the top of the columns are numbers.
The chart size is ignoring the numbers on the top of the columns. The numbers are cut out. The number on the top of the column is AggregateLabel.

You can see in the attached photo (chart with and without numbers). The chart size is the same with or witout AggregateLabel.

How can i take into account the AggregateLabel, that the chart would not cut the number, but adjusted the size.

Program language: PHP, ChartDirector version: 5010001

Thank you.

Best regards,
Peter S
chart with and witout AggregateLabel.png

  Re: The chart ignores AggregateLabel
Posted by Peter Kwan on Dec-02-2017 07:22
Hi Peter,

Unluckily, ChartDirector cannot automatically change the axis scale to ensure the bar with the label will stay inside the plot area.

To solve this problem, the usual method is to use Axis.setAutoScale or Axis.setMargin to reserve some space on top of the plot area. By default, ChartDirector auto-scaling will reserve at least 10% of the plot area height at the top, which is usually enough for horizontal aggregate labels. (For horizontal labels, the height depends on the font size but not on the label length, so it is simple to reserve the space.)

For your case, you are using vertical labels, which can be of any length depending on the label format and style you are using and the actual data. If you can estimate the length, you can try to use Axis.setMargin or Axis.setAutoScale to tell ChartDirector to amount of space to reserve on the top. It is like:

#reserve 100 pixels non-scaling margins on top
$c->yAxis->setMargin(100);

or

#increase the y-axis scale so that the top 25% is empty (to reserve space for the labels)
$c->yAxis->setAutoScale(0.25);

Regards
Peter Kwan

  Re: The chart ignores AggregateLabel
Posted by Peter S on Dec-04-2017 18:02
Thank you very much, it solved my problem.

Best regards,
Peter