Thank you Daniel.
I thins the role column is the right one for me.
I tried it like this:
Preparing the Data from the Database:
if ($dataobject->error=="0"){
$error=null;
}else $error= "X" ;
if($error=="X"){
$intmin=0;
$intmax=4000;
}else{
$intmin=null;
$intmax=null;
}
$data1=array($timed." ".$hourd);
if(isset($cha1)) $data1[]=$chad1;
if(isset($cha2)) $data1[]=$chad2;
if(isset($cha3)) $data1[]=$chad3;
if(isset($temp)) $data1[]=$tempd;
$data1[]=$intmin;
$data1[]=$intmax;
$data1[]=$error;
$data1[]=$errortext;
$data[]=$data1;
$chart_data = json_encode($data);
in the Javascript-part I have the following code:
var data = new google.visualization.DataTable();
data.addColumn('string', 'Time');
if(<?php if(isset($cha1)) echo $cha1; else echo "0"; ?>==1) {data.
addColumn('number', 'Zone 1');}
if(<?php if(isset($cha2)) echo $cha2; else echo "0"; ?>==1){ data.
addColumn('number', 'Zone 2');}
if(<?php if(isset($cha3)) echo $cha3; else echo "0"; ?>==1) {data.
addColumn('number', 'Zone 3');}
if(<?php if(isset($temp)) echo $temp; else echo "0"; ?>==1) {data.
addColumn('number', 'Temp');}
data.addColumn({type:'number', role:'interval'}); // interval role
col.
data.addColumn({type:'number', role:'interval'}); // interval role
col.
data.addColumn({type:'string', role:'annotation'}); // annotation
role col.
data.addColumn({type:'string', role:'annotationText'}); //
annotationText col.
data.addRows(<?php echo $chart_data ?>);
The chart is drawing but I cannot see my annotations "X" and my
annotationtext.
Can somebody help me?
Thank you
Nadja
Am Montag, 7. März 2016 18:47:05 UTC+1 schrieb Nadja:
>
> Hello,
>
> I have a line chart with data from a database.
> In the database I have a column called "error", where numbers or
> characters reflect the error code (e.g. 0=no error, A=Error in size,
> B=Error in....).
> If the error is not equal to "0" the data-set for this entry shall not be
> displayed in the graph; there should be a marker for this data-set
> (*/asterix/color-coded/...) to reflect that this data-set has an error.
> In principle I need the good old "if/then" function; IF the error-column
> is <>0, THEN display * or whatever...
> Can somebody help me, how to fix this with google line charts?
> Thank you
> Nadja
>
--
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 https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/8ed29a62-7123-4aba-855a-a147ca6a6499%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.