<?php
$annotation_data = mysql_query("SELECT DATE_FORMAT(xval,'%Y-%m-%d %H:%i:%s') AS xval1, xval, series, shortText, text
FROM annotations ORDER BY xval DESC LIMIT 1") or die(mysql_error());
$r_data1 = mysql_fetch_array($annotation_data);
$xval11 = 1417004339;
$series1 = $r_data1['series'];
$shortText1 = $r_data1['shortText'];
$text1 = $r_data1['text'];
?>
var ann = {
series: $series1,
xval: $xval11,
shortText: $shortText1,
text: $text1
};
var anns = graphdiv2.annotations();
anns.push(ann);
graphdiv2.setAnnotations(anns);
--
You received this message because you are subscribed to the Google Groups "dygraphs-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dygraphs-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<?php
$annotation_data = mysql_query("SELECT DATE_FORMAT(xval,'%Y/%m/%d %H:%i:%s') AS xval1, xval, series, shortText, text
FROM ".$database_anno." ORDER BY xval ") or die(mysql_error());
while($row = mysql_fetch_array($annotation_data))
{
$text = str_replace("\r\n", "<br>", $row['text']); // eingebaute Umbrüche ausbessern $aaa = " " .$aaa. "{series: '".$row[series]."', x: Date.parse('".$row[xval1]."'), shortText: '".$row[shortText]."', text: '" .$text."'}," ;
}
?>
graphdiv2.setAnnotations([<?php echo $aaa ?>]); // Annotations anzeigen
var dat = "[{series: 'AKKU [V]', x: Date.parse('2014/07/06 12:58:12'), shortText: 'A', text: 'Akku geladen'}]";
graphdiv2.setAnnotations(dat);
graphdiv2.setAnnotations([{series: 'AKKU [V]', x: Date.parse('2014/07/06 12:58:12'), shortText: 'A', text: 'Akku geladen'}]);