Skip to content

Instantly share code, notes, and snippets.

@Vodurden
Created April 11, 2013 06:03
Show Gist options
  • Save Vodurden/5361090 to your computer and use it in GitHub Desktop.
Save Vodurden/5361090 to your computer and use it in GitHub Desktop.
This is a small sample of code to highlight an error in the .NET Highcharts exporter. Attempting to export to the .NET highcharts exporter from this code with anything but a svg will cause an error because the width parameter is set to 0.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<script>
$(function () {
$('#container').highcharts({
exporting: {
url:'http://myserver/Highcharts/HighchartsExport.aspx'
},
chart: {
type: 'column'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
});
});
</script>
</head>
<body>
<div id="container" style="width:100%; height:400px;"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment