Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/465.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript HighChart系列中的自定义符号_Javascript_Highcharts - Fatal编程技术网

Javascript HighChart系列中的自定义符号

Javascript HighChart系列中的自定义符号,javascript,highcharts,Javascript,Highcharts,我在我的网页中有一个部分,其中我显示了一个HighChart图形,如下所示: Highcharts.chart('container', { chart: { type: 'line' }, title: { text: 'Monthly Average Temperature' }, subtitle: { text: 'Source: WorldClimate.com' }, xAxis:

我在我的网页中有一个部分,其中我显示了一个
HighChart
图形,如下所示:

Highcharts.chart('container', {
    chart: {
        type: 'line'
    },
    title: {
        text: 'Monthly Average Temperature'
    },
    subtitle: {
        text: 'Source: WorldClimate.com'
    },
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },
    yAxis: {
        title: {
            text: 'Temperature (°C)'
        }
    },
    plotOptions: {
        line: {
            dataLabels: {
                enabled: true
            },
            enableMouseTracking: true
        }
    },
    series: [{
        name: 'London',
        data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
    }]
});

我们可以看到点显示为
数字
。 我希望用
字符串
替换数字,例如'3.9%,'4.2%等等

当我将上述代码中的数据
数组
更改为包含“%”符号时,图表不会呈现。我猜
HighCharts.js
只允许绘制数字

'3.9%'、'4.2%'的自定义表示法如何使用。。等等,在图表中会显示出来吗

请专家们帮忙

谢谢

您可以使用具有良好格式的,如
格式:“{point.y}%”


非常感谢。它很好用。我需要详细研究HighCharts API。
series: [{
  name: 'London',
  data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8],
  dataLabels: {
    enabled: true,
    format: "{point.y} %"
  }
}]