From 423d15db30ab316eb912b83b863564d5c060ccd0 Mon Sep 17 00:00:00 2001 From: Sadik Moazzem Date: Mon, 3 Oct 2022 17:45:46 +0100 Subject: [PATCH] Added interface for exporting chart on ChartContext --- .../src/components/BaseChart/createProvidedChart.js | 1 + packages/react-jsx-highcharts/types/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/react-jsx-highcharts/src/components/BaseChart/createProvidedChart.js b/packages/react-jsx-highcharts/src/components/BaseChart/createProvidedChart.js index c7f212cb..02591f0e 100644 --- a/packages/react-jsx-highcharts/src/components/BaseChart/createProvidedChart.js +++ b/packages/react-jsx-highcharts/src/components/BaseChart/createProvidedChart.js @@ -15,6 +15,7 @@ const createProvidedChart = (chart, type) => ({ hideLoading: chart.hideLoading.bind(chart), addCredits: chart.addCredits.bind(chart), addAnnotation: chart.addAnnotation ? chart.addAnnotation.bind(chart) : null, + exportChart: chart.exportChart ? chart.exportChart.bind(chart) : null, removeAnnotation: chart.removeAnnotation ? chart.removeAnnotation.bind(chart) : null, diff --git a/packages/react-jsx-highcharts/types/index.d.ts b/packages/react-jsx-highcharts/types/index.d.ts index 3c8dc41a..e62cd1bf 100644 --- a/packages/react-jsx-highcharts/types/index.d.ts +++ b/packages/react-jsx-highcharts/types/index.d.ts @@ -352,6 +352,7 @@ type ChartContextValue = { addCredits: Highcharts.Chart['addCredits']; addAnnotation?: any; // missing type in highcharts removeAnnotation?: any; // missing type in highcharts + exportChart?: any; // missing type in highcharts /** * Debounced chart redraw */