0

我将此代码用于工具提示,但它没有显示浮点值,如 56.1%

tooltip: {
                headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                '<td style="padding:0"><b>{point.y:.1f} </b></td></tr>',
                footerFormat: '</table>',
                shared: true,
                useHTML: true
            }
4

1 回答 1

1

对我来说它工作得很好:http: //jsfiddle.net/3bQne/231/

确保您拥有最新版本的 Highcharts。

var chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container'
    },
    tooltip: {
            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
            '<td style="padding:0"><b>{point.y:.1f} </b></td></tr>',
            footerFormat: '</table>',
            shared: true,
            useHTML: true
        },
    series: [{
        type:'spline',
        data: [3.45,4.21,5.11]        
    },{
        type:'spline',
        data: [5,4,3]        
    }]
});
于 2013-06-14T11:26:55.497 回答