|
Invisible bottom border of a legend layout |
Posted by phil1308 on Sep-13-2012 20:49 |
|
Hello again,
still using Chart Director under myDBR Reporting, I have another little bug :
the legend box bottom border of a stacked bar chart the is not visible.
I don't know why.
Here is my source code :
select 'dbr.chart', 'StackedBar', '', 900, 400;
select 'dbr.chart.options', 'chartdirector', '$legendBox = $c->getLegend(); $legendBox-
>setBackground(0xEEEEEE, 0x000000); $legendBox->setFontSize(12); $legendBox-
>setCols(1);';
select 'dbr.chart.options', 'chartdirector', '$dataLabel = $layer->setDataLabelStyle("bold",
12); $dataLabel->setAlignment(5); $layer->setAggregateLabelFormat(" "); $c->xAxis-
>setLabelStyle("bold", 10, 0x000000, 0); $layer->setDataLabelFormat("{value|0}''");';
I joined a screen capture of the result.
Is it a bug or have I done something wrong ?
Thank you for answer.
|
Re: Invisible bottom border of a legend layout |
Posted by Eva on Sep-13-2012 23:03 |
|
Hi phil1308,
Would you mind to share the semi-transparent colors you used for your bars?
Thank you in advance,
Eva |
Re: Invisible bottom border of a legend layout |
Posted by phil1308 on Sep-13-2012 23:56 |
|
OK Eva,
I just included "alpha value" when I defined my own set of colors.
Here is the code :
select 'dbr.chart.color', '0x30548dd4', '0x308db3e2', '0x20c6d9f1', '0x20daeef3',
'0x30b6dde8', '0x3092cddc';
"Alpha values" are the first two digits in the hex code (the "30's" or "20's").
Hope it'll help.
Bonne journ?e (I'm french) |
Re: Invisible bottom border of a legend layout |
Posted by Peter Kwan on Sep-14-2012 00:17 |
|
Hi phil1308,
Is it possible the legend box is so large that it falls outside the chart image? Have you checked where is the border of your chart image? For testing, you may use c.setBorder(0x000000); to set the chart border to black, so you can see the border.
If the above is the cause of the problem, you may:
(a) Increase the chart height.
(b) Decrease the legend box height (eg. by using a smaller font)
(c) Decrease the plot area height, so that you can move the legend box up.
In ChartDirector Ver 5, there is a method XYChart.packPlotArea that may be used to adjust the plot area height to leave sufficient space for the legend box. See the sample code "Bars with Marks" and "Multi-Symbol Line Chart" for some examples of its usage.
Hope this can help.
Regards
Peter Kwan |
Re: Invisible bottom border of a legend layout |
Posted by phil1308 on Sep-14-2012 15:52 |
|
Thank you Peter for your anwer.
I found a way to solve my problem : I'va added these 2 functions to my source code :
$legendBox->setAlignment(2); $legendBox->setPos($c->getWidth() / 2, $c->getHeight() -
1);
It works fine !
Thank you. |
|