'Export Multiple highcharts with custom text into pdf
I want to export multiple charts with textareas in PDF i
How will I implement in the following above code? pLease guide me
Solution 1:[1]
You can use my previous idea from similar topic: Export highchart with free text entered as pdf
You can iterate over all of your charts and add them to your exported svg with texts related to these charts:
Highcharts.getSVG = function(charts, texts) {
var svgArr = [],
top = 0,
width = 0,
txt;
Highcharts.each(charts, function(chart, i) {
var svg = chart.getSVG();
svg = svg.replace('<svg', '<g transform="translate(0,' + top + ')" ');
svg = svg.replace('</svg>', '</g>');
top += chart.chartHeight;
width = Math.max(width, chart.chartWidth);
svgArr.push(svg);
txt = texts[i];
txt = '<text x= "' + 0 + '" y = "' + (top + 20) + '" styles = "' + txt.attributes.style.value + '">' + $(txt).val() + '</text>';
top += 60;
svgArr.push(txt);
});
return '<svg height="' + top + '" width="' + width + '" version="1.1" xmlns="http://www.w3.org/2000/svg">' + svgArr.join('') + '</svg>';
};
Here you can find an example how it can work: http://jsfiddle.net/6m2rneL8/32/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Community |