{
  "type": "object",
  "properties": {
    "valueDataset": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "subtitle": {
      "type": "string"
    },
    "chartType": {
      "enum": ["bar", "line"],
      "type": "string"
    },
    "aggregationType": {
      "enum": ["AVG", "COUNT", "MAX", "MIN", "SUM"],
      "type": "string"
    },
    "loadConf": {
      "type": "object",
      "properties": {
        "type": {
          "const": "Time",
          "type": "string"
        },
        "lead": {
          "type": "number"
        },
        "lag": {
          "type": "number"
        },
        "leadUnit": {
          "$ref": "#/definitions/DweenTimeUnit"
        },
        "lagUnit": {
          "$ref": "#/definitions/DweenTimeUnit"
        },
        "alignUnit": {
          "enum": [
            "CALENDAR_445",
            "DAYS",
            "HALFHOUR",
            "HOURS",
            "MILLIS",
            "MINUTES",
            "MONTHS",
            "SECONDS",
            "WEEKS",
            "YEARS"
          ],
          "type": "string"
        },
        "truncateStartUnit": {
          "description": "Snaps the *computed window start* down to this unit's boundary, after the lag has been\nsubtracted. Distinct from `alignUnit`, which truncates the reference time and so lands on the\nwindow's end: a 48-hour lag off an hour-aligned \"now\" starts mid-day, and `DAYS` here pulls it\nback to local midnight. Widens the window rather than shifting it. Default none/null.",
          "enum": [
            "DAYS",
            "HALFHOUR",
            "HOURS",
            "MILLIS",
            "MINUTES",
            "MONTHS",
            "SECONDS",
            "WEEKS",
            "YEARS"
          ],
          "type": "string"
        }
      },
      "required": ["alignUnit", "lag", "lagUnit", "leadUnit"]
    },
    "comparisonPeriod": {
      "type": "string"
    },
    "groupingMode": {
      "$ref": "#/definitions/GroupingMode"
    },
    "dateRangeSelectType": {
      "type": "string"
    },
    "updateFrequency": {
      "type": "number"
    },
    "dateFrom": {
      "type": "string"
    },
    "dateTo": {
      "type": "string"
    },
    "width": {
      "type": "number"
    },
    "height": {
      "type": "number"
    },
    "useDataUpToLastFinishedMonth": {
      "type": "boolean"
    },
    "useDataUpToLastFinishedWeek": {
      "type": "boolean"
    },
    "hideFutureValues": {
      "type": "boolean"
    },
    "hideLegend": {
      "type": "boolean"
    },
    "weeksRangeStartOffset": {
      "type": "number"
    },
    "weeksRangeEndOffset": {
      "type": "number"
    },
    "chartMargin": {
      "type": "object",
      "properties": {
        "t": {
          "type": "number"
        },
        "b": {
          "type": "number"
        },
        "l": {
          "type": "number"
        },
        "r": {
          "type": "number"
        }
      }
    },
    "baseline": {
      "description": "A reference series drawn over the values, e.g. a target or a norm.",
      "type": "object",
      "properties": {
        "dataset": {
          "description": "Dataset identifier; the baseline is off entirely while this is unset.",
          "type": "string"
        },
        "aggregation": {
          "description": "How readings sharing a bucket combine. Independent of the chart's own aggregation because a\nbaseline is usually a level rather than a quantity: daily readings on a weekly axis must not\nbe totalled into 7x the setpoint. Defaults to AVG.",
          "enum": ["AVG", "COUNT", "MAX", "MIN", "SUM"],
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "width": {
          "type": "number"
        },
        "dash": {
          "enum": [
            "dash",
            "dashdot",
            "dot",
            "longdash",
            "longdashdot",
            "solid"
          ],
          "type": "string"
        },
        "name": {
          "description": "Legend label; falls back to T(\"label.baseline\") when blank.",
          "type": "string"
        }
      }
    },
    "id": {
      "type": "string"
    },
    "reportOptions": {
      "$ref": "#/definitions/ReportOptions"
    },
    "reportMode": {
      "type": "boolean"
    },
    "stateCb": {
      "type": "object"
    },
    "calendarType": {
      "const": "CALENDAR_445",
      "type": "string"
    },
    "hideHeader": {
      "type": "boolean"
    },
    "theme": {
      "enum": ["dark", "light", "transparent"],
      "type": "string"
    }
  },
  "required": [
    "comparisonPeriod",
    "dateRangeSelectType",
    "groupingMode",
    "loadConf",
    "valueDataset"
  ],
  "definitions": {
    "DweenTimeUnit": {
      "enum": [
        "DAYS",
        "HALFHOUR",
        "HOURS",
        "MILLIS",
        "MINUTES",
        "MONTHS",
        "SECONDS",
        "WEEKS",
        "YEARS"
      ],
      "type": "string"
    },
    "GroupingMode": {
      "enum": ["CONTINUOUS", "YEARLY"],
      "type": "string"
    },
    "ReportOptions": {
      "type": "object",
      "properties": {
        "fontSize": {
          "type": "string"
        }
      }
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
