我希望在导出选项时以 xAxis 比例添加年份。我试过这段代码,它在 jsfiddle 中工作得很好,但在我的本地没有。
$(function () {
$('#container').highcharts({
exporting: {
chartOptions: { // specific options for the exported image
plotOptions: {
series: {
dataLabels: {
enabled: true
}
}
},
title: {
text: 'export Title'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
millisecond: '%b %e %Y',
second: '%b %e %Y',
minute: '%b %e %Y',
hour: '%b %e %Y',
day: '%b %e %Y',
week: '%b %e %Y',
month: '%b %e %Y',
year: '%b %e %Y'
}
},
},
scale: 3,
fallbackToExportServer: false
},
title: {
text: 'Offline export'
},
subtitle: {
text: 'Click the button to download as PNG/SVG'
},
chart: {
type: 'area'
},
xAxis: {
type:'dateTime'
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 126.0, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
});
此外,我尝试在导出选项中添加数据源,是否有任何解决方案。
以下是jsfiddle