If you are using TeeChart for PHP in HTML5 Builder XE3:
I can't find a way to set the pen thickness for a line graph. Nothing
on Google. Anyone out there who knows?
If you take the features demo included with the installation as reference, you'll find the Line2D example in it. After creating the chart:
$chart = new TChart(500,300);
The Line series are added and populated:
$line1=new Line($chart->getChart());
$data = Array(10,50,25,175,125,200,175);
$line1->addArray($data);
$line2=new Line($chart->getChart());
$line2->addXY(0,10);
$line2->addXY(1,15);
$line2->addXY(2,20);
$line2->addXY(3,25);
$line2->addXY(10,30);
$line3=new Line($chart->getChart());
$data = Array(200,175,175,100,65,110,90);
$line3->addArray($data);
Then, to make them wider, you can just:
$line1->getLinePen()->setWidth(2);
$line2->getLinePen()->setWidth(2);
$line3->getLinePen()->setWidth(2);
Or you could use the foreach loop already present:
foreach ($chart->getSeries() as $serie) {
//...
$serie->getLinePen()->setWidth(2);
}
Also, if one uses a Bar graph, one would think following code snippet
should disable the annotating marks over each bar:
$series1=$this->Chart2->addSeries(new TeeBar($this));
$series1->Marks->Visible = false;
Tt doesn't. Marks->Visible doesn't do anything. The default marks are still displayed.
Take a look at the Bar series example. It starts like this:
$chart1 = new TChart(500,300);
$chart1->getChart()->getHeader()->setText("Bar Style");
$chart1->getChart()->getAspect()->setChart3DPercent(30);
$bar=new Bar($chart1->getChart());
$chart1->getChart()->getSeries(0)->setColorEach(true);
$chart1->getChart()->getSeries(0)->fillSampleValues(10);
And you can see the marks in the first Bar chart. But adding the following to the above seems to hide the marks as expected for me here:
$chart1->getChart()->getSeries(0)->getMarks()->setVisible(false);
The same could be done just like this:
$bar->getMarks()->setVisible(false);
If you are using TeeChart HTML5/JavaScript in HTML5 Builder XE3:
I can't find a way to set the pen thickness for a line graph. Nothing
on Google. Anyone out there who knows?
You can do it through the format.stroke.size
property, as follows:
var Chart1;
function draw() {
Chart1=new Tee.Chart("canvas1");
line1=Chart1.addSeries(new Tee.Line());
line1.addRandom(25);
line1.format.stroke.size=2;
line2=Chart1.addSeries(new Tee.Line());
line2.addRandom(25);
Chart1.draw();
}
Also, if one uses a Bar graph, one would think following code snippet
should disable the annotating marks over each bar:
$series1=$this->Chart2->addSeries(new TeeBar($this));
$series1->Marks->Visible = false;
Tt doesn't. Marks->Visible doesn't do anything. The default marks are
still displayed.
This seems to work as expected for me here:
var Chart1;
function draw() {
Chart1=new Tee.Chart("canvas1");
bar1=Chart1.addSeries(new Tee.Bar());
bar1.addRandom(6);
bar1.marks.visible=false;
bar2=Chart1.addSeries(new Tee.Bar());
bar2.addRandom(6);
Chart1.draw();
}