Hi Daniel,
this is part of the code which utilizes the Google Chart.
<?php
foreach($symbols as $syms)
{
$ar_temp=array();
$history=array();
$start =12;
$length =28;
?>
<div data-role="page" id="<?=$syms."_chart";?>">
<div data-role="header" data-position="fixed">
<a href="#pageone" class="ui-btn ui-corner-none
ui-icon-back ui-btn-icon-left">Back</a>
<h1><?=$syms." Chart";?></h1>
</div>
<?php
$history_query = 'HISTORYNEW-symbol='.strtoupper($syms).
'|period=30|from='.(time() - (1 * 24 * 60 * 60)).'|to='.(time());
$history_result = MQ_Query($history_query);
if ($history_result != '!!!CAN\'T CONNECT!!!' )
{
$s=substr($history_result,0,$start);
$ar_temp=unpack("ibars/idigits/itimesign",$s);
$digits=$ar_temp["digits"];
?>
<script type="text/javascript" src=
"https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization","1",{packages:[
"corechart"]});
google.setOnLoadCallback(<?=$syms."Chart";?>)
function <?=$syms."Chart()";?>
{
<?php
$counter=0;
?>
var data = google.visualization.
arrayToDataTable([
<?php
$tmpstring="";
while($s=substr($history_result,$start,
$length))
{
$start+=$length;
//$s =
substr($history_result,$start,$length);
$history=unpack(
"itime/iopen/ihigh/ilow/iclose/dvol",$s);
$history["high"]+=$history["open"];
$history["high"]/=pow(10,$digits);
$history["low"]+=$history["open"];
$history["low"]/=pow(10,$digits);
$history["close"]+=$history["open"];
$history["close"]/=pow(10,$digits);
$history["open"]/=pow(10,$digits);
$tmpstring.="['".date("d M Y",$history[
"time"])."',".$history["low"].",".$history["open"].",".$history["close"].","
.$history["high"]."],";
}
unset($arr_temp);
unset($history);
$data=mb_substr($tmpstring,0,-1);
?>
<?=$data;?>],true);
var options={ legend:'none'};
var chart=new google.visualization.
CandlestickChart(document.getElementById('<?=$syms."_div";?>'));
chart.draw(data,options);
}
</script>
<?php
}
?>
<div data-role="main" class="ui-content" id="<?=$syms."_div"
;?>" height="200px">
</div>
</div>
<?php
}
unset($syms);
?>
Kindly check.
Thank you very much...
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/2b0b8837-15fc-4c92-be85-90239a541668%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.