---
  name: statictrend
  decscription: For each day max mpsas, max alt, avg phase
  in_parameters:
    - day1
      type: date
    - day2
      type: date

  out_parameters:
    - mdate
      type: date
    - mpsas
      type: float
    - alt
      type: float
    - phase
      type: float

  dataservice:
    type: service
    name: RunPostgresQuery
    sql: "SELECT mdate, max(mpsas) as mpsas, max(lunar_alt_deg) as alt, avg(lunar_phase) as phase FROM clearsky.observatorysqmreading 
WHERE mdate BETWEEN ? AND ? 
GROUP BY mdate 
ORDER BY mdate ASC"

  renderservice:
    type: embedded
    html: "<div class="container">

  <div>
    <canvas id="res" height=600px width=900px ></canvas>
  </div>
  
  
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  <script>
    
    const ctx = document.getElementById('res');
    new Chart(ctx, {
  type: 'line',
  data: data,
  options: {
    responsive: true,
    interaction: {
      mode: 'index',
      intersect: false,
    },
    stacked: false,
    plugins: {
      title: {
        display: true,
        text: '<<title>>'
      }
    },
    scales: {
      y: {
        type: 'linear',
        display: true,
        position: 'left',
      },
      <<set2>>
    }
  }
})
    
  </script>  
</div>"