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

Message ListMessage List     Post MessagePost Message

  Aggregate label for the negative bar above the 0 coordinate
Posted by Ritu on Dec-28-2012 23:24
I want the aggregate label of the negative bar above the 0 coordinate, currently it is
showing it in the -y zone.

following is the code, I am using

$layer->addCustomAggregateLabel( $i,"{value}%","arialbd.ttf", 15, 0xcc3300)-
>setAlignment($perlchartdir::TopCenter);

Can somebody help me how to add the label aggegate in the +y zone for negative bars.

Thanks and Regards,
Ritu

  Re: Aggregate label for the negative bar above the 0 coordinate
Posted by Peter Kwan on Dec-29-2012 00:38
Hi Ritu,

One method is to add a transparent line layer in which the data are all zeros. If the data value is negative, you can put the label on the line layer instead. The code is like:

$labelLayer = ($myData[$i] < 0) ? $transparentLineLayer : $layer;
$labelLayer->addCustomAggregateLabel( $i,"{value}%","arialbd.ttf", 15, 0xcc3300)-
>setAlignment($perlchartdir::TopCenter);

Hope this can help.

Regards
Peter Kwan

  Re: Aggregate label for the negative bar above the 0 coordinate
Posted by Peter Kwan on Dec-29-2012 00:43
Hi Ritu,

I have just noticed you are using Perl. In this case, if $myData is a reference to an array, then in the code in my last message, $myData[$i] should be $$myData[$i] instead.

Regards
Peter Kwan

  Re: Aggregate label for the negative bar above the 0 coordinate
Posted by Ritu on Dec-29-2012 15:40
Thanks your pointer worked fine.

Thanks and Regards,
Ritu