|
Line width |
Posted by Leo on Jan-02-2012 01:46 |
|
Hello, Peter, Happy New Year,
I was unable to set the width of a spline, wonder what went wrong...
Error:
unknown method XYChart.setLineWidth
*** Stack back trace ***
calling XYChart.setLineWidth at p.pl:17
Code:
#!/usr/bin/perl
use perlchartdir;
my $data = [100, 156, 179.5, 211, 123];
my $labels = ["Mon", "Tue", "Wed", "Thu", "Fri"];
my $c = new XYChart(200, 200);
$c->getLegend()->setPos(-9999, -9999);
$c->setPlotArea(-1, -1, $c->getWidth() + 2, $c->getHeight() + 2, 0xFFFFFF, 0xFFFFFF,
0xFFFFFF, 0xFFFFFF);
$c->addSplineLayer($data, 0x000000);
$c->setLineWidth(5);
$c->xAxis()->setLabels($labels);
$c->xAxis->setColors(0xFF0000,0xFF0000,0xFF0000,0xFF0000);
$c->yAxis->setColors(0xFF0000,0xFF0000,0xFF0000,0xFF0000);
$c->makeChart("p.png") |
Re: Line width |
Posted by Peter Kwan on Jan-03-2012 02:32 |
|
Hi Leo,
The setLineWidth is a method of the Layer object, not the XYChart object. (It sets the line width for the SplineLayer, not for everything in the chart.) So the code should be:
$layer = $c->addSplineLayer($data, 0x000000);
$layer->setLineWidth(5);
Hope this can help.
Regards
Peter Kwan |
|