Ask Your Question
2

How can I export a highchart graph that includes tooltips and labels?

asked 2022-04-27 11:00:00 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-12-05 04:00:00 +0000

ladyg gravatar image

To export a Highcharts graph with tooltips and labels, you can use the Highcharts.exportChart() method.

Here's an example code snippet:

var chart = Highcharts.chart('container', {
  // your chart options here
});

// add export button to chart
Highcharts.getOptions().exporting.buttons.contextButton.menuItems.push({
  text: 'Export',
  onclick: function () {
    chart.exportChart({ type: 'image/png' });
  }
});

The above code adds an export button to the Highcharts chart and exports the chart as a PNG image file. You can change the export format as per your requirement.

To include tooltips and labels in the exported chart, make sure to include the following options in your chart configuration:

tooltip: {
  enabled: true, // enable tooltips
  // other tooltip options
},
labels: {
  enabled: true, // enable labels
  // other label options
}

With these options in place, your Highcharts chart will include tooltips and labels when exported.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-04-27 11:00:00 +0000

Seen: 9 times

Last updated: Dec 05 '22