-
Notifications
You must be signed in to change notification settings - Fork 132
/
chart.schema.json
88 lines (88 loc) · 3.19 KB
/
chart.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/context/chart.schema.json",
"type": "object",
"title": "Chart",
"description": "A context type representing details of a Chart, which may be used to request plotting of a particular chart or to otherwise share details of its composition, such as:\n\n- A list of instruments for comparison\n- The time period to plot the chart over\n- The style of chart (line, bar, mountain, candle etc.)\n- Other settings such as indicators to calculate, or data representing drawings and annotations.\n\nIn addition to handling requests to plot charts, a charting application may use this type to output a representation of what it is currently displaying so that it can be recorded by another application.",
"allOf": [{
"type": "object",
"properties": {
"type": { "const": "fdc3.chart" },
"instruments": {
"title": "Instruments to plot",
"description": "An array of instrument contexts whose data should be plotted.",
"type": "array",
"items": {
"$ref": "instrument.schema.json#"
}
},
"range": {
"title": "Time Range",
"description": "The time range that should be plotted",
"allOf": [{
"$ref": "timerange.schema.json#"
}]
},
"style": {
"title": "Chart style",
"description": "The type of chart that should be plotted",
"type": "string",
"enum": [ "line", "bar", "stacked-bar", "mountain", "candle", "pie", "scatter", "histogram", "heatmap", "custom"]
},
"otherConfig": {
"title": "Other configuration",
"description": "It is common for charts to support other configuration, such as indicators, annotations etc., which do not have standardized formats, but may be included in the `otherConfig` array as context objects.",
"type": "array",
"items": {
"$ref": "context.schema.json#"
}
}
},
"required": ["instruments"]
},
{ "$ref": "context.schema.json#/definitions/BaseContext" }
],
"examples": [
{
"type": "fdc3.chart",
"instruments": [
{
"type": "fdc3.instrument",
"id": {
"ticker": "AAPL"
}
},
{
"type": "fdc3.instrument",
"id": {
"ticker": "GOOG"
}
}
],
"range": {
"type": "fdc3.timeRange",
"startTime": "2020-09-01T08:00:00.000Z",
"endTime": "2020-10-31T08:00:00.000Z"
},
"style": "line",
"otherConfig": [
{
"type": "somevendor.someproduct.indicator",
"name": "stddev",
"parameters": {
"period": 10,
"matype": "exponential"
}
},
{
"type": "someothervendor.someotherproduct.formula",
"formula": "standard-deviation",
"fields": {
"lookback": 10,
"type": "ema"
}
}
]
}
]
}