3 How to configure X
Aurora Lahtela edited this page 2024-01-21 13:19:27 +02:00

Plan Header

How to configure ___?

This page has some frequently asked configuration/customization how-to's listed. They are optional.

How to configure the website to use different time format? (12h / 24h)

Configuring time formats of the timestamps

Configuring time formats of the graphs

Specific graph

Add a new dateTimeLabelFormats to the graph's configuration options. (Note that xAxis section may also be needed)

    xAxis: {
        dateTimeLabelFormats: {
            hour: '%H:%M',
            day: '%e. %b',
        },
    },

See https://api.highcharts.com/highcharts/xAxis.dateTimeLabelFormats for pattern reference

All graphs

Add some configuration at the top of the graphs.js file

Highcharts.setOptions({
    xAxis: {
        dateTimeLabelFormats: {
            hour: '%H:%M',
            day: '%e. %b',
        },
    }
});

See https://api.highcharts.com/highcharts/xAxis.dateTimeLabelFormats for pattern reference

How to add more time buttons to graphs

Change the buttons sections in the file

                        buttons: [{
				type: 'hour',
				count: 1,
				text: '1h'
			},{
				type: 'hour',
				count: 6,
				text: '6h'
			},{
				type: 'hour',
				count: 12,
				text: '12h'
			},{
				type: 'hour',
				count: 24,
				text: '24h'
			},{
				type: 'day',
				count: 7,
				text: '7d'
			},{
				type: 'month',
				count: 1,
				text: '30d'
			},{
				type: 'all',
				text: 'All'
			}]