{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "name": "Chart",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "title": {
            "type": "string",
            "description": "Chart title"
        },
        "width": {
            "type": "number",
            "description": "Chart width"
        },
        "height": {
            "type": "number",
            "description": "Chart height"
        },
        "axis": {
            "type": "array",
            "description": "List of chart axes",
            "additionalProperties": false,
            "items": {
                "type": "object",
                "properties": {
                    "label": {
                        "type": "string",
                        "description": "Axis label"
                    },
                    "type": {
                        "type": "string",
                        "description": "Location of the axis",
                        "enum": [
                            "top",
                            "bottom",
                            "left",
                            "right"
                        ]
                    },
                    "unit": {
                        "type": "string",
                        "description": "Unit represented on this axis"
                    },
                    "unitWrapperBefore": {
                        "type": "string",
                        "description": "Additional string to use before the unit"
                    },
                    "unitWrapperAfter": {
                        "type": "string",
                        "description": "Additional string to use after the unit"
                    },
                    "min": {
                        "type": "number",
                        "description": "Minimum value for this axis"
                    },
                    "max": {
                        "type": "number",
                        "description": "Maximum value for this axis"
                    },
                    "flip": {
                        "type": "boolean",
                        "description": "Are the axis values in reverse order?"
                    }
                }
            }
        },
        "data": {
            "type": "array",
            "description": "Chart serie(s)",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "label": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string",
                        "description": "Type of the serie",
                        "enum": [
                            "line",
                            "scatter",
                            "bar",
                            "box"
                        ]
                    },
                    "x": {
                        "type": "array",
                        "description": "X values",
                        "items": {
                            "type": "number"
                        }
                    },
                    "y": {
                        "type": "array",
                        "description": "Y values",
                        "items": {
                            "type": "number"
                        }
                    },
                    "z": {
                        "type": "array",
                        "description": "Z values",
                        "items": {
                            "type": "number"
                        }
                    },
                    "errorX": {
                        "type": "array",
                        "description": "Symmetrical error bars X",
                        "items": {
                            "oneOf": [
                                {
                                    "type": "number",
                                    "description": "One level symmetrical X error bars"
                                },
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "number",
                                        "description": "Multi-level symmetrical X error bars : [level1, level2, ...]"
                                    }
                                }
                            ]
                        }
                    },
                    "errorXleft": {
                        "type": "array",
                        "description": "Asymmetrical left error bars X",
                        "items": {
                            "oneOf": [
                                {
                                    "type": "number",
                                    "description": "One level asymmetrical X error bars"
                                },
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "number",
                                        "description": "Multi-level asymmetrical X error bars : [level1, level2, ...]"
                                    }
                                }
                            ]
                        }
                    },
                    "errorXright": {
                        "type": "array",
                        "description": "Asymmetrical right error bars X",
                        "items": {
                            "oneOf": [
                                {
                                    "type": "number",
                                    "description": "One level asymmetrical X error bars"
                                },
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "number",
                                        "description": "Multi-level asymmetrical X error bars : [level1, level2, ...]"
                                    }
                                }
                            ]
                        }
                    },
                    "errorY": {
                        "type": "array",
                        "description": "Symmetrical error bars Y",
                        "items": {
                            "oneOf": [
                                {
                                    "type": "number",
                                    "description": "One level symmetrical Y error bars"
                                },
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "number",
                                        "description": "Multi-level symmetrical Y error bars : [level1, level2, ...]"
                                    }
                                }
                            ]
                        }
                    },
                    "errorYtop": {
                        "type": "array",
                        "description": "Asymmetrical top error bars Y",
                        "items": {
                            "oneOf": [
                                {
                                    "type": "number",
                                    "description": "One level asymmetrical Y error bars"
                                },
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "number",
                                        "description": "Multi-level asymmetrical Y error bars : [level1, level2, ...]"
                                    }
                                }
                            ]
                        }
                    },
                    "errorYbottom": {
                        "type": "array",
                        "description": "Asymmetrical bottom error bars Y",
                        "items": {
                            "oneOf": [
                                {
                                    "type": "number",
                                    "description": "One level asymmetrical Y error bars"
                                },
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "number",
                                        "description": "Multi-level asymmetrical Y error bars : [level1, level2, ...]"
                                    }
                                }
                            ]
                        }
                    },
                    "orientation": {
                        "type": "string",
                        "description": "Orientation used for box plot",
                        "enum": [
                            "x",
                            "y"
                        ]
                    },
                    "boxes": {
                        "type": "array",
                        "description": "Array of information for box plot",
                        "items": {
                            "x": {
                                "type": "number",
                                "description": "x"
                            },
                            "y": {
                                "type": "number",
                                "description": "y"
                            },
                            "Q1": {
                                "type": "number",
                                "description": "Q1"
                            },
                            "Q2": {
                                "type": "number",
                                "description": "Q2"
                            },
                            "Q3": {
                                "type": "number",
                                "description": "Q3"
                            },
                            "whiskers": {
                                "type": "array",
                                "description": "Whiskers",
                                "items": {
                                    "type": "number"
                                }
                            },
                            "outliers": {
                                "type": "array",
                                "description": "Outliers",
                                "items": {
                                    "type": "number"
                                }
                            }
                        }
                    },
                    "info": {
                        "type": "array",
                        "description": "Additional information about the data points"
                    },
                    "xAxis": {
                        "type": "number",
                        "description": "Index of the x axis in the axis array"
                    },
                    "yAxis": {
                        "type": "number",
                        "description": "Index of the y axis in the axis array"
                    },
                    "zAxis": {
                        "type": "number",
                        "description": "Index of the z axis in the axis array"
                    },
                    "style": {
                        "type": "array",
                        "description": "Styling of each point of the serie",
                        "items": {
                            "type": "object",
                            "description": "An sub-element of style",
                            "items": {
                                "shape": {
                                    "type": "string",
                                    "description": "Shape of the point (square, round, cross, ...)"
                                },
                                "zoom": {
                                    "type": "number",
                                    "description": "Defines the size of the point"
                                },
                                "lineWidth": {
                                    "type": "number",
                                    "description": "Width of the line defining the shape"
                                },
                                "lineColor": {
                                    "type": "string",
                                    "description": "Color of the line defining the shape"
                                },
                                "fillColor": {
                                    "type": "string",
                                    "description": "Color of the shape"
                                },
                                "points": {
                                    "description": "Points for which this style is valid"
                                }
                            }
                        }
                    },
                    "lineStyle": {
                        "type": "array",
                        "description": "Styling of the line between the points of the serie. Available only for the line serie",
                        "items": {
                            "type": "object",
                            "items": {
                                "styleName": {
                                    "type": "string",
                                    "description": "The name of the style"
                                },
                                "color": {
                                    "type": "string",
                                    "description": "The color of the line, the scatter points, or the bar"
                                },
                                "lineWidth": {
                                    "type": "number",
                                    "description": "If the serie is a line, its width. Otherwise, ignored"
                                },
                                "lineStyle": {
                                    "description": "Some parameter describing further styling of the line"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}