{
  "type": "object",
  "properties": {
    "productTemplate": {
      "$ref": "#/definitions/ProductTemplateScatter"
    },
    "latestEntryCount": {
      "type": "number"
    },
    "bubbleChart": {
      "type": "boolean"
    },
    "xAxisIdentifier": {
      "type": "string"
    },
    "yAxisIdentifier": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/YAxisIdentifier"
      }
    },
    "yAxisIdentifierSelectionType": {
      "enum": ["Multiple", "Single"],
      "type": "string"
    },
    "colorAxisIdentifier": {
      "type": "string"
    },
    "sizeAxisIdentifier": {
      "type": "string"
    },
    "useGPURendering": {
      "type": "boolean"
    },
    "highlightCount": {
      "type": "number"
    },
    "trendLines": {
      "type": "boolean"
    },
    "discreteColorMode": {
      "type": "boolean"
    },
    "discreteValues": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "number"
          },
          "value": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": ["key", "title", "value"]
      }
    },
    "highlightedValuesDescription": {
      "type": "string"
    },
    "axisConfig": {
      "type": "object",
      "properties": {
        "xRange": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "yRange": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      }
    },
    "imageConfig": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "sizex": {
          "type": "number"
        },
        "sizey": {
          "type": "number"
        },
        "opacity": {
          "type": "number"
        }
      },
      "required": ["opacity", "sizex", "sizey", "source", "x", "y"]
    },
    "annotationsConfig": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "text": {
            "type": "string"
          },
          "showarrow": {
            "type": "boolean"
          },
          "xanchor": {
            "enum": ["auto", "center", "left", "right"],
            "type": "string"
          },
          "yanchor": {
            "enum": ["auto", "bottom", "middle", "top"],
            "type": "string"
          },
          "hovertext": {
            "type": "string"
          },
          "font": {
            "type": "object",
            "properties": {
              "color": {
                "type": "string"
              },
              "size": {
                "type": "number"
              }
            }
          },
          "opacity": {
            "type": "number"
          },
          "bordercolor": {
            "type": "string"
          },
          "borderpad": {
            "type": "number"
          },
          "borderwidth": {
            "type": "number"
          },
          "arrowcolor": {
            "type": "string"
          },
          "arrowside": {
            "enum": ["end", "start"],
            "type": "string"
          },
          "arrowwidth": {
            "type": "number"
          },
          "bgcolor": {
            "type": "string"
          },
          "textangle": {
            "type": "string"
          }
        },
        "required": ["text", "x", "y"]
      }
    },
    "identifiers": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "height": {
      "type": ["string", "number"]
    },
    "width": {
      "type": ["string", "number"]
    },
    "showDateSelection": {
      "type": "boolean"
    },
    "hideRefresh": {
      "type": "boolean"
    },
    "loadConf": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "Time",
              "type": "string"
            },
            "lead": {
              "type": "number"
            },
            "lag": {
              "type": "number"
            },
            "leadUnit": {
              "$ref": "#/definitions/DweenTimeUnit"
            },
            "lagUnit": {
              "$ref": "#/definitions/DweenTimeUnit"
            },
            "alignUnit": {
              "enum": [
                "DAYS",
                "HALFHOUR",
                "HOURS",
                "MILLIS",
                "MINUTES",
                "MONTHS",
                "SECONDS",
                "WEEKS",
                "YEARS"
              ],
              "type": "string"
            }
          },
          "required": ["alignUnit", "lag", "lagUnit", "leadUnit"]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "Product Entry"
            },
            "productTemplateId": {
              "type": "string"
            },
            "startAttribute": {
              "type": "string"
            },
            "endAttribute": {
              "type": ["null", "string"]
            },
            "refName": {
              "type": "string"
            }
          },
          "required": [
            "endAttribute",
            "productTemplateId",
            "startAttribute",
            "type"
          ]
        }
      ]
    },
    "updateFrequency": {
      "type": "number"
    },
    "downsampleInterval": {
      "type": "number"
    },
    "bins": {
      "type": "object",
      "properties": {
        "start": {
          "type": "number"
        },
        "end": {
          "type": "number"
        },
        "size": {
          "type": "number"
        }
      }
    },
    "loading": {
      "type": "boolean"
    },
    "dynamicHeight": {
      "type": "boolean"
    },
    "legend": {},
    "xaxisName": {
      "type": "string"
    },
    "chartConf": {
      "$ref": "#/definitions/ILineChartConf"
    },
    "datasets": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/DatasetSpecification"
      }
    },
    "toggleTracesGrouping": {
      "type": "boolean"
    },
    "timeAxisStepSeconds": {
      "type": "number"
    },
    "chartDialogOpen": {
      "type": "boolean"
    },
    "selectedChartType": {
      "type": "string"
    },
    "dateFrom": {
      "$ref": "#/definitions/JSJoda.Instant"
    },
    "dateTo": {
      "$ref": "#/definitions/JSJoda.Instant"
    },
    "xAxisType": {
      "enum": ["array", "category", "date"],
      "type": "string"
    },
    "setMinYAxis": {
      "type": "number"
    },
    "setMaxYAxis": {
      "type": "number"
    },
    "dateAndRefreshButtonsVisible": {
      "type": "boolean"
    },
    "productTemplateCreationDate": {
      "$ref": "#/definitions/JSJoda.Instant"
    },
    "currentYAxisRange": {
      "type": "object",
      "properties": {
        "min": {
          "type": "number"
        },
        "max": {
          "type": "number"
        }
      },
      "required": ["max", "min"]
    },
    "annotations": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Annotation"
      }
    },
    "hideHeader": {
      "type": "boolean"
    },
    "hideLegend": {
      "type": "boolean"
    },
    "showFilter": {
      "type": "boolean"
    },
    "defaultFilter": {
      "type": "string"
    },
    "optionalFilters": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/OptionalFilter"
      }
    },
    "filter": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "reportOptions": {
      "$ref": "#/definitions/ReportOptions"
    },
    "reportMode": {
      "type": "boolean"
    },
    "stateCb": {
      "type": "object"
    },
    "calendarType": {
      "const": "CALENDAR_445",
      "type": "string"
    }
  },
  "required": ["title", "trendLines", "xAxisIdentifier", "yAxisIdentifier"],
  "definitions": {
    "ProductTemplateScatter": {
      "type": "object",
      "properties": {
        "productTemplateId": {
          "type": "number"
        },
        "productTemplateRefName": {
          "type": "string"
        },
        "templateXAttributeId": {
          "type": "string"
        },
        "templateYAttributeId": {
          "type": "string"
        },
        "templateSizeAttributeId": {
          "type": "string"
        },
        "templateColorAttributeId": {
          "type": "string"
        },
        "lastEntryCount": {
          "type": "number"
        }
      }
    },
    "YAxisIdentifier": {
      "anyOf": [
        {
          "$ref": "#/definitions/YAxisIdentifierWithOverriddenTitle"
        },
        {
          "type": "string"
        }
      ]
    },
    "YAxisIdentifierWithOverriddenTitle": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string"
        },
        "overriddenTitle": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "opacity": {
          "type": "number"
        },
        "useBorder": {
          "type": "boolean"
        }
      },
      "required": ["identifier"]
    },
    "DweenTimeUnit": {
      "enum": [
        "DAYS",
        "HALFHOUR",
        "HOURS",
        "MILLIS",
        "MINUTES",
        "MONTHS",
        "SECONDS",
        "WEEKS",
        "YEARS"
      ],
      "type": "string"
    },
    "ILineChartConf": {
      "type": "object",
      "properties": {
        "mode": {
          "enum": ["lines", "lines+markers", "text+lines+markers"],
          "type": "string"
        },
        "marker": {
          "$ref": "#/definitions/IMarkerConfig"
        }
      },
      "required": ["marker", "mode"]
    },
    "IMarkerConfig": {
      "type": "object",
      "properties": {
        "size": {
          "type": "number"
        }
      },
      "required": ["size"]
    },
    "DatasetSpecification": {
      "type": "object",
      "properties": {
        "stringValueMapper": {
          "type": "number"
        },
        "overriddenTitle": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "line": {
          "$ref": "#/definitions/ILineConfig"
        },
        "range": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "color": {
          "type": "string"
        },
        "bgColor": {
          "type": "string"
        }
      },
      "required": ["identifier"]
    },
    "ILineConfig": {
      "type": "object",
      "properties": {
        "backoff": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            {
              "type": "number"
            }
          ]
        },
        "color": {
          "type": "string"
        },
        "dash": {
          "type": "string"
        },
        "shape": {
          "type": "string"
        },
        "simplify": {
          "type": "boolean"
        },
        "smoothing": {
          "type": "number"
        },
        "width": {
          "type": ["null", "number"]
        }
      }
    },
    "JSJoda.Instant": {
      "type": "object"
    },
    "Annotation": {
      "type": "object",
      "properties": {
        "date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "text": {
          "type": "string"
        },
        "dataset": {
          "type": ["null", "string"]
        },
        "y": {
          "type": ["null", "number"]
        }
      },
      "required": ["dataset", "date", "text", "y"]
    },
    "OptionalFilter": {
      "type": "object",
      "properties": {
        "filter": {
          "type": "string"
        },
        "label": {
          "type": "string"
        }
      },
      "required": ["filter", "label"]
    },
    "ReportOptions": {
      "type": "object",
      "properties": {
        "fontSize": {
          "type": "string"
        }
      }
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
