JSFiddle - React, Tailwind, and code Playground

by hfrntt

HTML

<script type="text/javascript" src="http://highcharts.com/js/testing.js"></script>

<div id="container" style="height: 300px"></div>

JavaScript

$(document).ready(function() {
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            height: 500,
            margin: 50
        },
        xAxis: {
            type: 'datetime',
            startOnTick: true,
            endOnTick: true,
            showLastLabel: true,
            showFirstLabel: true,
            labels: {
                formatter: function(){
                    if (this.isFirst || this.isLast)
                        return Highcharts.dateFormat(this.dateTimeLabelFormat, this.value);
                    else
                        return '';
                }
            }
        },
        credits: {
            enabled: false
        },
        series: [{
            data: [
                
                [Date.UTC(2007, 05, 29), 300], // This x-axis value should be labeled.
                [Date.UTC(2007, 09, 03), 300], // NO LABEL for this value
                [Date.UTC(2007, 09, 04), 200] // This x-axis value should be labeled.
            ]}]
    });

})