Demo of xAxis.plotLines.color

by stitot

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<script src="https://code.highcharts.com/themes/adaptive.js"></script>

<script src="https://cdn.jsdelivr.net/npm/@highcharts/[email protected]" type="module"></script>

<figure class="highcharts-figure">
  <div id="container"></div>
</figure>

CSS

* {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        "Apple Color Emoji",
        "Segoe UI Emoji",
        "Segoe UI Symbol",
        sans-serif;
}

.highcharts-figure {
    max-width: 800px;
    margin: 1em auto;
}

.highcharts-controls-wrapper {
    max-width: 800px;
    margin: 1em auto;
    padding: 0 10px;
}

highcharts-controls {
    display: inline-block;
}

JavaScript

Highcharts.chart('container', {
    title: {
        text: 'Demo of <em>xAxis.plotLines.color</em>'
    },
    xAxis: {
        plotLines: [{
            color: '#ff8888',
            value: '2026-06-15',
            width: 2
        }],
        type: 'datetime'
    },
    plotOptions: {
        series: {
            pointIntervalUnit: 'month',
            pointStart: '2026-01-01'
        }
    },
    series: [{
        data: [
            29.9, 71.5, 106.4, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1,
            95.6, 54.4
        ]
    }]
});