Highcharts - 如何更改字体大小?

时间:2014-09-07 13:41:15

标签: css highcharts

我需要在高屏上更改云中的字体大小。 怎么做?

HTML:

<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>

JavaScript的:

$(function () {
    $('#container').highcharts({
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        title: {
            style: {
                color: '#FF00FF',
                fontWeight: 'bold'
            }
        },
        series: [{
            data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
        }]
    });
});

JSFiddle:http://jsfiddle.net/autrmg62/

屏幕:

Screen

1 个答案:

答案 0 :(得分:3)

Working example

我的自定义代码已用于第4-12行。

tooltip: {
    shared: true,
    useHTML: true,
    headerFormat: '<span style="font-size: 20px; color: red;">{point.key}</span><br/>',
    style: {
        fontWeight: 'bold',
        fontSize: '13px'
    }     
}, 

您想要的元素样式由headerFormat完成,并在style=""

中指定所需的样式

请查看: Highchart API reference

相关问题