I'm dong a school assignment currently.It's an investment website which has interactive chart by using open-flash-chart with latest update. It's design is similar to google finance's interactive flash chart.
I have obtained share price data from yahoo finance by using the simplehtmldom. Hyperlink for share price data:http://finance.yahoo.com/q/hp?s=4707.KL&a=00&b=1&c=2003&d=11&e=27&f=2010&g=m
and then present the data(data.php) with open flash chart.
my question is, how we passing the share price data that we have obtained from yahoo finance to "data.php" which use to output the data for open flash chart.
The Open-flash-chart's method http://teethgrinder.co.uk/open-flash-chart-2/tutorial-4.php
my code: share price obtained
<?php
require_once("simple_html_dom.php");
$html=file_get_html("http://finance.yahoo.com/q/hp?s=4707.KL&a=00&b=1&c=2003&d=11&e=27&f=2010&g=m");
foreach($html->find('td[class=yfnc_tabledata1]') as $e)
{ echo "$e->innertext . <br />";
}
?>
code: data.php
<?php
include 'php-ofc-library/open-flash-chart.php';
$max = 20;
$tmp = array();
require_once("simple_html_dom.php");
$html=file_get_html("http://finance.yahoo.com/q/hp?s=4707.KL&a=00&b=1&c=2003&d=11&e=27&f=2010&g=m");
foreach($html->find('td[class=yfnc_tabledata1]') as $e)
{ $tmp=$e->innertext;
if ($tmp == 'int')
{ $line = new line();
$line->set_values( array() );
}
}
$title = new title( date("D M d Y") );
$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $line );
echo $chart->toString();
?>
Can anyone give me some guidance for doing this?