@@ -97,6 +97,8 @@ def post(cls, request, *args, **kwargs):
9797 | `label` | The label to assign on the legend for this individual plot | Females | No |
9898 | `line_colour` | The colour to use for the line of this individual plot | BLUE | No |
9999 | `line_type` | The type to assign for this individual plot i.e. SOLID or DASH | DASH | No |
100+ | `is_public` | Whether the chart is for the public / non-public dashboard environment | True | Yes |
101+ | `data_classification` | The watermark wording (only for non-public charts) | OFFICIAL-SENSITIVE | No |
100102
101103 ---
102104
@@ -225,6 +227,51 @@ class EncodedChartsView(APIView):
225227 request = EncodedChartsRequestSerializer ,
226228 responses = {HTTPStatus .OK .value : EncodedChartResponseSerializer },
227229 tags = [CHARTS_API_TAG ],
230+ examples = [
231+ OpenApiExample (
232+ "COVID-19 encoded SVG example" ,
233+ value = {
234+ "file_format" : "svg" ,
235+ "x_axis" : "date" ,
236+ "y_axis" : "metric" ,
237+ "is_public" : False ,
238+ "data_classification" : "OFFICIAL-SENSITIVE" ,
239+ "plots" : [
240+ {
241+ "topic" : "COVID-19" ,
242+ "metric" : "COVID-19_cases_casesByDay" ,
243+ "chart_type" : "bar" ,
244+ "date_from" : "2022-01-01" ,
245+ "date_to" : "2023-02-01" ,
246+ }
247+ ],
248+ },
249+ request_only = True ,
250+ ),
251+ OpenApiExample (
252+ "COVID-19 encoded SVG response example" ,
253+ value = {
254+ "last_updated" : "2023-02-01" ,
255+ "chart" : "%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20900%20300%22%3E%3Ctext%20x%3D%22450%22%20y%3D%22150%22%20text-anchor%3D%22middle%22%3EOFFICIAL%20SENSITIVE%3C%2Ftext%3E%3C%2Fsvg%3E" ,
256+ "alt_text" : "There is only 1 plot on this chart. The horizontal X-axis is labelled 'date'. Whilst the vertical Y-axis is labelled 'metric'. This is a blue solid bar plot showing COVID-19 cases by day." ,
257+ "figure" : {
258+ "data" : [
259+ {
260+ "x" : ["2023-01-01" , "2023-01-02" ],
261+ "y" : [100 , 150 ],
262+ "type" : "bar" ,
263+ }
264+ ],
265+ "layout" : {
266+ "title" : "COVID-19 Cases by Day" ,
267+ "xaxis" : {"title" : "Date" },
268+ "yaxis" : {"title" : "Cases" },
269+ },
270+ },
271+ },
272+ response_only = True ,
273+ ),
274+ ],
228275 )
229276 @cache_response ()
230277 @require_authorisation
@@ -249,6 +296,8 @@ def post(cls, request, *args, **kwargs):
249296 | `label` | The label to assign on the legend for this individual plot | Females | No |
250297 | `line_colour` | The colour to use for the line of this individual plot | BLUE | No |
251298 | `line_type` | The type to assign for this individual plot i.e. SOLID or DASH | DASH | No |
299+ | `is_public` | Whether the chart is for the public / non-public dashboard environment | True | Yes |
300+ | `data_classification` | The watermark wording (only for non-public charts) | OFFICIAL-SENSITIVE | No |
252301
253302 ---
254303
0 commit comments