|
$c->setLabelFormat |
Posted by Xochitl on Aug-23-2014 00:45 |
|
So, I use the next sentence for draw the Chartdirector:
$c->setLabelFormat("<*block*>{label}<*font=arialbd.ttf,color=FF0000*> \\${value}K<*br*><*block*>\\n <*block,halign=center*><*color=000000*>({percent}%)<*block*>");
But I need set ${value} with other array value, its values I don't use in the chart parameters, not are sector values, is other array.
I use sector values for calculates percent, would you help me, please? |
Re: $c->setLabelFormat |
Posted by Peter Kwan on Aug-23-2014 01:42 |
|
Hi Xochitl,
You can add an additional field using BaseChart.addExtraField, and then use {field0} to
represent that field in the label. It is like:
my $additionalData = [111, 222, 333, ...];
$c->addExtraField($additionalData);
$c->setLabelFormat("<*block*>{label}<*font=arialbd.ttf,color=FF0000*> \\${value}K :
{field0}<*br*><*block*>\\n <*block,halign=center*><*color=000000*>({percent}%)
<*block*>");
Hope this can help.
Regards
Peter Kwan |
Re: $c->setLabelFormat |
Posted by Xochitl on Aug-23-2014 02:23 |
|
Thanks a lot Peter |
Re: $c->setLabelFormat |
Posted by Xochitl on Aug-23-2014 02:48 |
|
Another question:
Whats meaning ${value}K, K parameter? |
Re: $c->setLabelFormat |
Posted by Peter Kwan on Aug-26-2014 00:18 |
|
Hi Xochitl,
The K has no meaning. It is simply copied to the output unchanged.
For example, if the data value is 123, and your format the label to be "{value}", then it
would display "123". If you format the label to be "{value}K", then it would display "123K". If
you format the label to be "{value}Kilobytes", then it would display "123Kilobytes". So the
text outside the {value} is just copied to the output.
Hope this can help.
Regards
Peter Kwan |
Re: $c->setLabelFormat |
Posted by Xochitl on Aug-26-2014 04:23 |
|
Sorry, all is ok.
Tank you Peter. |
|