Hello,
I'm actually working for a society and trying to use TeeChart PHP for some web graphs.
I never used this object and i encounter some problems with the basics.
I just whant to diplay a simple graph with a 2 dimension table (X and Y) and put a Point for each x-y couple.
I follow the tutorial and understant what they did but they explain no where how to draw points instead of Bar or Line.
So if someone can indicate me how to simply dray points with X and Y as variables and how to just change the colors
(how to use" set Color(new Color(XXX,XXX,XXX)) ").
And eventually how to change the shape of the point (point,cross and so...).
Thank you for your help and sorry for my poor english.
Some help with teeChart PHP
Re: Some help with teeChart PHP
Hi,
Please, take a look at the feature demo included with the installation. You'll find examples about the majority of series.
I see the example of the Points series does it with sample values:
In your case, you can substitute it for, ie:
Or you could add your points with Color directly:
Please, take a look at the feature demo included with the installation. You'll find examples about the majority of series.
I see the example of the Points series does it with sample values:
Code: Select all
$points = new Points($chart1->getChart());
$points->fillSampleValues();
Code: Select all
$points = new Points($chart1->getChart());
for ($i=0; $i<25; $i++) {
$points->addXY($i, $i*10);
}
Once you have added the points, you can change the colors, ie, like this:cydarex wrote:how to just change the colors
(how to use" set Color(new Color(XXX,XXX,XXX)) ").
Code: Select all
$points->setColorEach(true);
$palette=Theme::getOperaPalette();
for ($i=0; $i<$points->getCount(); $i++) {
$points->getColors()->setColor($i, $palette[$i%sizeof($palette)]);
}
Code: Select all
$points->setColorEach(true);
$palette=Theme::getOperaPalette();
for ($i=0; $i<25; $i++) {
$points->addXYColor($i, $i*10, $palette[$i%sizeof($palette)]);
}
For example:cydarex wrote:And eventually how to change the shape of the point (point,cross and so...).
Code: Select all
$points->getPointer()->setStyle(PointerStyle::$CIRCLE);
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |