# draw some zones

A zone helps to split the graph into zones. Zones are between 2 X values `drawZone(zones)`

* `zones` is an array of zone objects
  * `color`: the color of the zone as web color or RGB hex (will be a little bit transparent for the background, and full opacity for the text if any (`sn`) if it is a string. It can also be an object with background and text fields to separate those (`color:{text:'white', background:'none'}`)
  * `size`: the font-size to apply on the `sn` text (css size)
  * `sn`: a short text that will be displayed vertically onto the border of the zone
  * `extent`: an array of 2 dates/numbers which are the X min and the X max values of the zone
  * `opacity`: the opacity of the zone. By default, it is 0.2

```javascript
  const oooi = this.oooi = (OOOI.history().filter(e=>['ON', 'OFF'].includes(e[0])));
  const zones = this.oooi.reduce((zones, e)=>{
    zones.data.push( {
      id: e.date,
      color: (e[0]=="ON")?'grey':'steelblue',
      sn: '',
      size: "0.3em",
      extent: [+moment.utc(e.date), zones.currentDate]
    });
    zones.currentDate=+moment.utc(e.date);
    return zones;
  }, {currentDate: +this.timeDomain[1], data:[]}).data;

  mygraph.drawZone(zones);  

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flightwatching.com/user-manual/designer-user-manual/edit-dashboards/dashboards/dashboard-rules/graphs/draw-some-zones.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
