简体   繁体   中英

Changing Highcharts font size

I'm looking at using HighCharts for a webpage, specifically:

http://www.highcharts.com/demo/column-basic/dark-green

However, the font sizes are too small. I've tried adding:

legend: {
        itemStyle: {
            color: '#000000',
            fontWeight: 'bold',
            fontSize: '15px'
        }

to my js file that the site provided but this doesn't result in a font size change. Additionally I would also like to increase the size of the key (where it states Tokyo, New York, London, Berlin). This is my first time using Highcharts and I've been doing research for a couple hours now and I can't seem to find the answer. Any help would be much appreciated!

For legend font size, your code is working perfect. Here is working demo .

and for X-axis and Y-axis,put the font size in (x-Axis/y-Axis)->labels->style object: Here is the sample :

 xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            labels: {
                style: {
                    color: 'red',
                    fontSize:'15px'
                }
            }
        },

Demo : http://jsfiddle.net/4VznG/

I was having an issue setting fontSize of my x-Axis labels. Setting it using font in the labels worked for me:

xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
        labels: {
            style: {
                color: 'red',
                font: '13px Arial, sans-serif'
            }
        }
    },
xAxis: {
        categories: ['Climate Change', 'Marketing', 'Development', 'Customer Support',
                'Information Technology', 'Administration'],
        tickmarkPlacement: 'on',
        lineWidth: 0,
        labels: {

            style: {
                fontSize: '14px',
                fontFamily: 'Verdana, sans-serif',

            }}
    },

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM