Source for file ScatterPlot.class.php
Documentation is available at ScatterPlot.class.php
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
require_once dirname(__FILE__ ). "/Plot.class.php";
* @package linea21.externals
* Add marks to the scatter plot
* Construct a new awScatterPlot
* @param array $datay Numeric values for Y axis
* @param array $datax Numeric values for X axis
$this->mark->border->show();
* Display plot as impulses
* @param awColor $impulse Impulses color (or NULL to disable impulses)
* Link scatter plot points
* @param awColor $color Line color (default to black)
public function link($link, $color = NULL) {
$this->link = (bool) $link;
* Ignore null values for Y data and continue linking
public function setColor(awColor $color) {
* Get the background color or gradient of an element of the component
* @return Color, Gradient
public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) {
// Get start and stop values
list ($start, $stop) = $this->getLimit();
for($key = 0; $key < $count; $key++ ) {
$polygon->set($key, NULL);
foreach($polygon->all() as $point) {
if($prev !== NULL and $point !== NULL) {
foreach($polygon->all() as $key => $point) {
foreach($polygon->all() as $key => $point) {
$this->mark->draw($driver, $point);
$this->label->draw($driver, $point, $key);
|