react-jsx-highcharts icon indicating copy to clipboard operation
react-jsx-highcharts copied to clipboard

Ability to export a graph

Open SadikMoazzem opened this issue 2 years ago • 6 comments

Feature Request

Description

Be able to use the useChart Hook to access other methods on the Chart class

@anajavi Is there any reason they haven't been added in already, i see there is a few added in without types currently.

SadikMoazzem avatar Oct 03 '22 16:10 SadikMoazzem

It can be added in here, but I am not able to create a branch to open a PR currently! packages/react-jsx-highcharts/src/components/BaseChart/createProvidedChart.js

image

SadikMoazzem avatar Oct 03 '22 16:10 SadikMoazzem

Given its a one line change, perhaps you can make a pull request for this?

  • Fork this repo
  • Make your changes
  • Create a pull request against this repo

farridav avatar Oct 04 '22 08:10 farridav

The chart is already accessible with useChart:

const c = useChart();
const chart = c.object;

anajavi avatar Oct 04 '22 09:10 anajavi

I am trying to access the "exportChart" method, which doesn't exist on the chart obj

image

Looking to add it to the exposed interface in "BaseChart/createProvidedChart.js" or wherever it should fit

SadikMoazzem avatar Oct 04 '22 09:10 SadikMoazzem

I am trying to access the "exportChart" method, which doesn't exist on the chart obj

image

There probably isn't typescript definition for exportChart as it is added via highcharts module.

Did you try to run your code ignoring typescript warnings for exportChart?

anajavi avatar Oct 10 '22 11:10 anajavi

https://github.com/whawker/react-jsx-highcharts/pull/375 Hey, why aren't you merging this?

ozadari5 avatar May 15 '23 14:05 ozadari5