co20.gplot 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. ############################
  2. # Display the current voc (volatile organic compounds) value in three color gradients.
  3. # Corresponding FileLog definition:
  4. # define <fileLogDefinitionName> FileLog ./log/co20-%Y-%m.log <co20 sensor name>
  5. # define <webLinkDefinitionName> SVG <fileLogDefinitionName>:co20:CURRENT
  6. # attr <webLinkDefinitionName> label "Air quality - Min $data{min1}, Max $data{max1}, Last $data{currval1}"
  7. set terminal png transparent size <SIZE> crop
  8. set output '<OUT>.png'
  9. set xdata time
  10. set timefmt "%Y-%m-%d_%H:%M:%S"
  11. set xlabel " "
  12. set title '<L1>'
  13. set ytics "good" 750, "ok" 1250, "bad" 1750
  14. set y2tics "" 1000,"" 1500
  15. set grid y2tics
  16. set ylabel ""
  17. set y2label "Air quality (ppm)"
  18. set yrange [450:2000]
  19. set y2range [450:2000]
  20. #FileLog 4:voc::
  21. #FileLog 4:voc::$fld[3]>1000?1000:$fld[3]
  22. #FileLog 4:voc::$fld[3]>1500?1500:$fld[3]
  23. #FileLog 4:voc::$fld[3]>2000?2000:$fld[3]
  24. plot "<IN>" using 1:2 axes x1y2 title 'Air quality (ppm)' ls l5 lw 0.2 with lines,\
  25. "<IN>" using 1:2 axes x1y2 title ' ' ls l1fill lw 0.2 with lines,\
  26. "<IN>" using 1:2 axes x1y2 title ' ' ls l4fill lw 0.2 with lines,\
  27. "<IN>" using 1:2 axes x1y2 title ' ' ls l0fill lw 0.2 with lines