score:0
import react from 'react';
import highchartsreact from 'highcharts-react-official';
import highcharts from 'highcharts/highcharts';
import exporting from 'highcharts/modules/exporting';
exporting(highcharts)
class chart extends component {
componentdidmount() {
console.log(this.refs[chartref].getsvg());
}
render() {
return (
<highchartsreact
highcharts={highcharts}
options={...youroptions}
ref="chartref"
/>);
}
}
export default chart;
here you can access getsvg. just include exporting(highcharts)
score:1
follow the below codes to implement in yours:
const reacthighcharts = require('react-highcharts');
class mycomponent extends react.component {
componentdidmount() {
let chart = this.refs.chart.getchart();
let svg = chart.getsvg(); // this is your svg
}
render() {
return <reacthighcharts config={config} ref="chart"/>;
}
}
if the above code under componentdidmount() didn't work, then try this code:
componentdidupdate() {
if (this.refs.chart) {
let chart = this.refs.chart.refs.chart;
let html = document.createelement('html');
html.innerhtml = chart.innerhtml;
let svg = html.getelementsbytagname('svg')[0].outerhtml; // this is your svg
}
}
Source: stackoverflow.com
Related Query
- How to use Highcharts React to create chart with multiple lines for same XAxis?
- how can I use rangeselector and navigation in highcharts in the given code
- How to use highcharts with angular 5?
- How To Use Epoch Time With Highcharts Series Data?
- Can we use Highcharts with React-Native?
- How to use highcharts with princeXML?
- How do I use an Highcharts Solid Gauge in angular 6 with typescript?
- How can i force Highcharts to use same symbols in Legend and Series?
- Is there any way we can use Highcharts with mPDF converter?
- Can I use highcharts in a pdf generate with prawn in Rails?
- How do I use Highcharts to display candlestick with small values?
- How to use Highmaps and Highcharts with Meteor?
- How can I force ticks/grid lines on a Highcharts datetime X axis to arbitrarily line up with data points?
- How to scale Highcharts height on window resize with React
- How to draw a bubble map with longitude and latitude using Highcharts in react
- How can I make a graph with highcharts from csv file?
- How can I align gridlines with dots in Highcharts
- How can I pass values from Highcharts event callbacks (click, mouseOver, mouseOut) back to React component member function?
- How to use Highcharts in typescript and react
- how can I use highcharts no-data-to-display module as es6-module?
- How can I deal with Highcharts inline styles to prevent Content-Security-Policy violations?
- How can I update two highcharts with one dropdown menu?
- how to use highcharts tooltip formatter in python code
- How can I make React Native in Android aware of a click event in a tooltip in a Highcharts chart?
- How can I make milestone lines with a GANTT chart using the highcharts library?
- How to convert string array to ints to use with Highcharts
- How can I display crosshair labels on top of the chart with Highcharts
- How can I get a chart only with legends using highcharts
- How is the proper way to use HighCharts with StencilJS?
- How to use highcharts in reactjs with fetched data from API
More Query from same tag
- Highcharts toggle between multiple datasets
- JSFiddle 'Please use Post Requst' error
- Highcharts polar steps
- Show tootip and select pie slice on legend click of pie chart in HighCharts
- Add the average line of a serie to a chart
- Multiple data series and multiple data tooltip with HighMaps
- enable disable hover in highchart.stock
- dragging cannot get to the beginning of chart highcharts
- $scope.$watch ... make it return a function on another scope?
- How to change the background series colour of Highcharts Radar chart
- Highcharts pointPlacement ignored in version 2.3.5
- Change color of selected point in HighCharts dynamically
- How to disable dragging of Highcharts annotations?
- How I can stick together the lines on the Highcharts timeline chart?
- rCharts HighCharts X-axs grouping
- Highstock disable Tooltip but show Flag
- how to use function (chart) in react?
- Getting highcharts to re-animate a line graph
- Save and load highcharter graph in R
- change dataLabels on highcharts based on color of bar
- Angular : SetData to HighChart widget from an array object
- Highcharts Solid Gauge Legend Symbol
- Unable to draw Spline on secondary Y Axis (getting data from CSV file) using highchart
- Use redraw to get data from chart, Jsfiddle provided
- highcharts.js change color of the lines in the background
- How to get y-axis boundary line using highchart?
- Highcharts area charts with single data, not rendering
- Highcharts Point Value Disappearing
- Highcharts nodeName of undefined
- how to parse json into highcharts