|
Draw spline chart through selected points of time series |
Posted by mike Gibbons on Sep-04-2015 05:59 |
|
Hi Peter,
So if I have a time series of stock prices and I wanted to draw a curve through just 3 points in the series, how would I do that. (see example).
Regards,
Mike Gibbons
|
Re: Draw spline chart through selected points of time series |
Posted by Peter Kwan on Sep-05-2015 03:26 |
|
Hi Mike,
You can add a spline layer with a data series that just contain 3 points (with all other
points being NoValue). For example:
# Add the main chart with 240 pixels in height
$mainChart = $c->addMainChart(240);
# An array with all points being NoValue except 3 points
$myData = array_pad(array(), count($timeStamps), NoValue);
$myData[40] = $closeData[40];
$myData[60] = $closeData[60];
$myData[80] = $closeData[80];
# Add a spline layer
$mainChart->addSplineLayer($myData, 0x0000ff);
Hope this can help.
Regards
Peter Kwan |
|