首页 > 解决方案 > Highcharts 导出服务器不导出标签

问题描述

演示:https ://jsfiddle.net/L6ca89dh/4/

当我导出(单击汉堡包并单击导出 SVG)时,数据标签显示正常。

当我使用我的 highcharts-export-server 时,它们不会:

在此处输入图像描述

*** 这是应该的样子:

在此处输入图像描述

图表项的代码片段

var chart = {
title: {
  text: null
},
time: {
  useUTC: false
},
chart: {
  width: 1200,
  height: 600,
  plotBackgroundColor: null,
  plotBorderWidth: 0,
  plotShadow: false,
  spacing: 0,
        type: 'spline'
},
xAxis: {
  //startOnTick: true
},
    yAxis: {
    title: {
        text: 'Performance (%)'
    },
    //min: 0
},      
legend: {
  enabled: true,
        navigation: false,
        itemStyle: {"fontSize": "11px", "fontWeight": "normal"}
},
rangeSelector: {
  enabled: false
},
scrollbar: {
  enabled: false
},
navigator: {
  enabled: false
},
credits: {
  enabled: false
},
plotOptions: {
        spline: {
            compare: 'percent',
        marker: {
            enabled: true
        }
    },
},
series: series
  };

标签: svgchartshighchartsserverexport

解决方案


您的意思是在您使用节点导出服务器 ( https://github.com/highcharts/node-export-server )时,在导出的图像上看不到系列标签?如果是这样,其背后的原因是因为系列标签脚本(https://code.highcharts.com/modules/series-label.js )不包含在构建中的其他附加脚本(例如 xrange)中。 .js文件。您需要做的就是添加以下内容:

'{{version}}/modules/series-label.js': 1

cdnScriptsOptional数组中运行node build.js。有关更多信息,您可以访问导出服务器的 repo ( https://github.com/highcharts/node-export-server )。


推荐阅读