Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Want to export chart created using jquery to pdf.I used itextsharp.dll for exporting but i could not export jquery chart to pdf.please help me

What I have tried:

I cant found proper solution.I just search in Google
Posted
Updated 1-Apr-16 21:29pm

1 solution

Why don't you just use the built in PDF function of Highcharts, you will see a button on the top right allowing export.
You will need to add the following line:

<script src="http://code.highcharts.com/modules/exporting.js" type="text/javascript"></script>
 
Share this answer
 
Comments
aparnaChandras 2-Apr-16 6:23am    
I have added this line and write following code
into highchart function but still it doesn't work
aparnaChandras 2-Apr-16 6:26am    
$('#MCBreakDownTime').highcharts({
chart: {
type: 'column',
alignTicks: true,
animation: true,
backgroundColor: '#FFFFFF',
borderColor: ' #4572A7',
borderRadius: 5,
borderWidth: 1

},
title: {
text: '<%=Resources.Resource.MCBreakDownCaption %>'
},
xAxis: {
categories: machineArrName
},
yAxis: {
min: 0,
title: {
text: '<%=Resources.Resource.TotalTimeCaption %>'
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
},
legend: {
layout: 'horizontal',
verticalAlign: 'bottom',
borderWidth: 0,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
tooltip: {
formatter: function () {
return '' + this.x + '<br/>' +
this.series.name + ': ' + this.y;
}
},

plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
}
}
},
exporting: {
enabled:true,
buttons: {
contextButton: {
menuItems: [{
text: 'Export to PNG (small)',
onclick: function () {
this.exportChart({
width: 250
});
}
}, {
text: 'Export to pdf ',
onclick: function () {
this.exportChart({type : 'application/pdf'});
},
separator: false
}]
}
}
},
series: series
});


}
Alan Perez 19-Jun-18 10:35am    
This is the worst answer, 'cause, maybe he want to create a pdf with more information, and he only want to put a chart with these data.

it's a complement.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900