Ghozally
Ghozally

Reputation: 93

Change Font dateTimeLabel Highstock

How can I increase font from the tooltip (highlighted in red) in high-stock chart ?

enter image description here

Upvotes: 1

Views: 45

Answers (1)

Udhay Titus
Udhay Titus

Reputation: 5869

use tooltip:headerFormat it will works

    tooltip: {
      headerFormat: '<span style="font-size:18px">{point.x:%A, %b %e, %Y}</span>'
    }

$(document).ready(function(){
    $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function (data)    {
        // Create the chart
        
        var dataObject = {
            rangeSelector: {
                selected: 1,
                inputEnabled: $('#container').width() > 480
            },
            
            title: {
                text: 'AAPL Stock Price'
            },
            
            series: [{
                name: 'AAPL',
                data: data,
                tooltip: {
                    valueDecimals: 2
                }
            }],
            tooltip: {
            headerFormat: '<span style="font-size:18px">{point.x:%A, %b %e, %Y}</span>'
    },
            chart: {
                renderTo: 'container'
            }
        };
        
        var chart = new Highcharts.StockChart(dataObject);   
        //var chart = $('#container').highcharts('StockChart', dataObject);
    });
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/modules/exporting.js"></script>

<div id="container" style="height: 400px; min-width: 310px"></div>

Upvotes: 1

Related Questions