paramcurve.php
Back to Chart Graphics
setPlotArea(70, 65, 400, 350, 0xffffff, -1, 0xc0c0c0, 0xc0c0c0, -1);
# Add a legend box with the top center point anchored at (270, 30). Use horizontal layout. Use 10pt
# Arial Bold Italic font. Set the background and border color to Transparent.
$legendBox = $c->addLegend(270, 30, false, "Arial Bold Italic", 10);
$legendBox->setAlignment(TopCenter);
$legendBox->setBackground(Transparent, Transparent);
# Add a title to the chart using 18 point Times Bold Itatic font.
$c->addTitle("Parametric Curve Fitting", "Times New Roman Bold Italic", 18);
# Add titles to the axes using 12pt Arial Bold Italic font
$c->yAxis->setTitle("Axis Title Placeholder", "Arial Bold Italic", 12);
$c->xAxis->setTitle("Axis Title Placeholder", "Arial Bold Italic", 12);
# Set the axes line width to 3 pixels
$c->yAxis->setWidth(3);
$c->xAxis->setWidth(3);
# Add a scatter layer using (dataX0, dataY0)
$c->addScatterLayer($dataX0, $dataY0, "Polynomial", GlassSphere2Shape, 11, 0xff0000);
# Add a degree 2 polynomial trend line layer for (dataX0, dataY0)
$trend0 = $c->addTrendLayer2($dataX0, $dataY0, 0xff0000);
$trend0->setLineWidth(3);
$trend0->setRegressionType(PolynomialRegression(2));
$trend0->setHTMLImageMap("{disable}");
# Add a scatter layer for (dataX1, dataY1)
$c->addScatterLayer($dataX1, $dataY1, "Exponential", GlassSphere2Shape, 11, 0x00aa00);
# Add an exponential trend line layer for (dataX1, dataY1)
$trend1 = $c->addTrendLayer2($dataX1, $dataY1, 0x00aa00);
$trend1->setLineWidth(3);
$trend1->setRegressionType(ExponentialRegression);
$trend1->setHTMLImageMap("{disable}");
# Add a scatter layer using (dataX2, dataY2)
$c->addScatterLayer($dataX2, $dataY2, "Logarithmic", GlassSphere2Shape, 11, 0x0000ff);
# Add a logarithmic trend line layer for (dataX2, dataY2)
$trend2 = $c->addTrendLayer2($dataX2, $dataY2, 0x0000ff);
$trend2->setLineWidth(3);
$trend2->setRegressionType(LogarithmicRegression);
$trend2->setHTMLImageMap("{disable}");
# Output the chart
$viewer = new WebChartViewer("chart1");
$viewer->setChart($c, SVG);
# Include tool tip for the chart
$viewer->setImageMap($c->getHTMLImageMap("", "", "title='[{dataSetName}] ({x}, {value})'"));
?>
Parametric Curve Fitting
Parametric Curve Fitting
renderHTML(); ?>