0
我想將higcharts數據導出爲excel。我能夠做到這一點唯一的問題是我想出口字符串以及數據。但是,highcharts不會將字符串導出爲數據值,並且在Excel表格中它將返回undefined。將excel中的Highcharts數據以字符串的形式導出
$(function() {
// Create the chart
var options1 =
{
chart: {
renderTo: 'container0',
borderColor: '#dddddd',
borderWidth: 1,
borderRadius: 10,
type: 'column',
spacingBottom: 20,
spacingTop: 20,
spacingLeft: 20,
spacingRight: 20,
width: 378,
height: 237,
// backgroundColor: 'blue'
},
navigation: {
buttonOptions: {
verticalAlign: 'top',
y: -9,
x: 15,
symbolSize: 10,
symbolHeight: 30,
symbolStrokeWidth: 0,
strokeWidth: 0,
theme: {
fill: 'black',
zIndex: 6
},
ry: 5,
rx: 5
}
},
credits: {
enabled: false,
text: 'Only top 10 records displayed',
position: {
align: 'right',
y: -5
},
href: "javascript:void(0)",
style: {
fontSize: '10',
cursor: "normal"
}
},
exporting: {
sourceWidth: 480,
sourceHeight: 300,
scale: 1
},
title: {
style: {
'fontSize': '1em'
},
useHTML: true,
x: -27,
y: 8,
text: null
},
xAxis: {
name: "Fruit",
categories: ['11/15/2015','11/22/2015','11/29/2015','12/6/2015','12/13/2015','12/20/2015','12/27/2015']
},
labels: {
style: {
fontSize: '9px'
}
},
yAxis: {
title: {
text: ''
},
min: 0,
max: 150,
tickInterval: 20,
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
style: {
fontWeight: 'normal',
color: 'grey'
},
format: '{point.y}',
},
shadow: {
width: 5,
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
},
series: [{
name: 'Accounts Reached',
color: {
linearGradient: { x1: 1, x2: 1, y1: 1, y2: 0 },
stops: [
[0, '#12486d'],
[1, '#279ef2']
]
},
pointWidth: 30,
data: [19, 132, 25, 28, 82, 1, 1],
visible:false
}, {
name: 'Week',
color: {
linearGradient: { x1: 1, x2: 1, y1: 1, y2: 0 },
stops: [
[0, '#12486d'],
[1, '#279ef2']
]
},
visible:false,
pointWidth: 30,
data: [19, 132, 25, 28, 82, 1, 1]
}, {
name: 'Leads',
color: {
linearGradient: { x1: 1, x2: 1, y1: 1, y2: 0 },
stops: [
[0, '#12486d'],
[1, '#279ef2']
]
},
pointWidth: 30,
data: [19, 166, 39, 37, 107, 1, 1]
}, {
name: 'Campaign ID',
color: {
linearGradient: { x1: 1, x2: 1, y1: 1, y2: 0 },
stops: [
[0, '#12486d'],
[1, '#279ef2']
]
},
pointWidth: 30,
data: [18223, 18223, 18223, 18223, 18223, 18223, 18223],
visible:false
}, {
name: 'week start2',
color: {
linearGradient: { x1: 1, x2: 1, y1: 1, y2: 0 },
stops: [
[0, '#12486d'],
[1, '#279ef2']
]
},
pointWidth: 30,
data: ["Mon", "Mon", "Mon", "Mon", "Mon", "Mon", "Mon"],
visible: false
}
]
}
var chart = new Highcharts.Chart(options1);
});
我不希望顯示在圖表上的字符串數據我唯一的要求是多列導出Excel中可能包含數據串也。
所以,你可以請建議我該怎麼做才能做到這一點?我正在嘗試幾天。 –