|
pie center |
Posted by Leo on Jul-12-2013 11:57 |
|
Hello, Peter,
How to make the pie center point as sharp as a needle?
Right now, it's kind of round.
perl code:
~~~
#!/usr/bin/perl
use perlchartdir;
my $img = shift;
my $depth = 0;
my $data = [5, 95];
my $c = new PieChart(100, 110);
$c->setPieSize(50, 50, 48);
$c->set3D($depth);
$c->setColors2($perlchartdir::DataColor, [0x0000ff, 0xcccccc]);
$c->setData($data);
$c->setSectorStyle($perlchartdir::FlatShading, 0x0000ff, 4);
$c->setLabelStyle("", 8, $perlchartdir::Transparent);
$c->makeChart("pie.png");
~~~
|
Re: pie center |
Posted by Peter Kwan on Jul-12-2013 21:02 |
|
Hi Leo,
The pie center point is already as sharp as a needle. If you explode the sector, you can see clearly. See the attached chart image.
What you think is round is not the pie center point. It is the border of the grey sector. In your chart, you happened to use a blue color as the sector color, and also the same blue color as the thick sector border, so it may cause an illusion that the rounded corner is that of the sector blue sector. The rounded corner is in fact not part of the blue border, and is not at the center as well.
For your case, I suggest you not to use a thick sector border. If you want to have a blue circle surrounding the pie (but not a border for the sectors), you may consider to just draw a blue circle under the pie. It is like:
use perlchartdir;
my $img = shift;
my $depth = 0;
my $data = [5, 95];
my $c = new PieChart(110, 110);
$c->getDrawArea()->circle(55, 55, 53, 53, 0x0000ff, 0x0000ff);
$c->setPieSize(55, 55, 48);
$c->set3D($depth);
$c->setColors2($perlchartdir::DataColor, [0x0000ff, 0xcccccc]);
$c->setData($data);
$c->setLabelStyle("", 8, $perlchartdir::Transparent);
$c->makeChart("pie.png");
Hope this can help.
Regards
Peter Kwan
|
Re: pie center |
Posted by Leo on Jul-12-2013 23:29 |
|
Yes, Sir. |
|