0

I have plotting large set of data in line graph like item Vs sale count. I could display data table below the graph after i clicked "view data table" from set of export options. But i couldn't export it as pdf file. Please guide me to export data tables as pdf.

  • You can export data table if it is an svg element. See the FAQ from Highcharts website how you can achieve that - http://www.highcharts.com/docs/getting-started/frequently-asked-questions#add-data-table – morganfree Feb 06 '17 at 11:21
  • In this JS fiddle, they plotted the data table along with graph. -http://jsfiddle.net/highcharts/z9zXM/... So when they click on svg,pdf,jpeg etc, it would show graph and data table. But In my process, the data table will be displayed only when they select the "view data table" from export options.(at runtime) So i couldn't follow the above method. – Keerthi Keyan Feb 06 '17 at 12:20
  • You can show/hide the table by putting the entire table in an svg group and control its visibility attribute. Based on that, you can export chart with the callback which will draw the table or do noop. http://jsfiddle.net/z9zXM/1399/ Last thing, I guess, is controlling the size of the chart - depending if the table is shown/hidden - so the empty space will not be visible. – morganfree Feb 06 '17 at 13:24
  • Thanks for the detailed explanation. I have 3 graph in vertically one by one. If i display the table along with graph, customer needs to scroll(for more distance) to see third graph because each graph has large set of data. Also empty space makes no sense when the data table is not displayed. – Keerthi Keyan Feb 07 '17 at 05:50
  • A JS fiddle for this case is already available from highchart official. http://jsfiddle.net/highcharts/j4w4s0mw/ In that fiddle, when i click on "view data table" from export options, it would display the x and y values in data table at runtime. Along with that, I have to download the data table in pdf format. Please guide me to download the data tables. – Keerthi Keyan Feb 07 '17 at 05:52
  • To get rid off the empty space, you need to update the legend offset - it causes that the chart does not fill the entire box http://jsfiddle.net/z9zXM/1404/ IN the example you provided the table is rendered in html, not svg, and it is not possible to use Highcharts export server to export that table. If you want to export only html (without graph), you can see the answer [here](http://stackoverflow.com/questions/23035858/export-html-table-to-pdf-using-jspdf) – morganfree Feb 07 '17 at 14:06
  • I resolved this issue with the help of above post. i needs to download only table(only html). So I followed the post you are mentioned. Now everything works fine. Thanks morgan for your support. – Keerthi Keyan Feb 08 '17 at 08:34

0 Answers0