|
Bug with length of label line on piecharts/donuts |
Posted by jerome on May-31-2012 05:17 |
|
The best way to explain this is with 2 examples.
The 1st image shows a donut with 3D set to 1
See code below
my $piechartObj = new PieChart(@$chartSize);
$piechartObj->setDonutSize(@$pieSize);
$piechartObj->set3D(1); ######### Line that will be commented out
$piechartObj->setLabelLayout($perlchartdir::SideLayout);
$piechartObj->setLabelPos(5, $perlchartdir::LineColor);
$piechartObj->setLabelFormat("{label} ({percent|1}%)");
my $labelStyle = $piechartObj->setLabelStyle();
$labelStyle->setBackground(0xFFFFFF, $perlchartdir::Transparent);
The top label (Submitted - No Execution (5.6%)) looks about right, even though the label
line is much longer than it should be.
The 2nd image is created without the set3D() line and this time the top label line is much
longer than it should be and the label associated with it (Submitted - No Execution (5.6%))
ends up outside the drawing area.
Please help.
Thanks.
|
Re: Bug with length of label line on piecharts/donuts |
Posted by Peter Kwan on Jun-01-2012 02:20 |
|
Hi jerome,
I have tried your code, but I cannot reproduce the problem.
I noticed that your code should not be the complete code. For example, by default, ChartDirector will layout the slices so that the first slice starts from the top center. However, in your case, there seems to be a line that calls setStartAngle to shift the start angle. There are probably other lines that sets the color, and sets the data. May be these other code is required to reproduce the problem.
Also, in your full charting code, do you have other code that try to configure a single slice? It is possible to make the join line of a particular slice longer by using Sector.setJoinLine or Sector.setLabelPos.
Is it possible to provide me with your complete charting code, as well as the contents of the variables (such as the @$pieSize and @$chartSize) and the data values used, to help me reproduce the problem? Also, is the problem happening only with your current data? If you change the data (so that the Submitted - No Execution (5.6%) label is no longer at the top center position), is the join line still longer than expected?
Regards
Peter Kwan |
Re: Bug with length of label line on piecharts/donuts |
Posted by jerome on Jun-01-2012 02:48 |
|
I looked at the code again (it didn't write it originally. I was just changing it) and you are
100%
right!
There was another setLabelLayout set to 30, right before the makeChart; that was the
culprit.
Thanks for the quick response!
Peter Kwan wrote:
Hi jerome,
I have tried your code, but I cannot reproduce the problem.
I noticed that your code should not be the complete code. For example, by default,
ChartDirector will layout the slices so that the first slice starts from the top center.
However, in your case, there seems to be a line that calls setStartAngle to shift the start
angle. There are probably other lines that sets the color, and sets the data. May be
these other code is required to reproduce the problem.
Also, in your full charting code, do you have other code that try to configure a single
slice? It is possible to make the join line of a particular slice longer by using
Sector.setJoinLine or Sector.setLabelPos.
Is it possible to provide me with your complete charting code, as well as the contents of
the variables (such as the @$pieSize and @$chartSize) and the data values used, to help
me reproduce the problem? Also, is the problem happening only with your current data? If
you change the data (so that the Submitted - No Execution (5.6%) label is no longer at
the top center position), is the join line still longer than expected?
Regards
Peter Kwan
|
|