Multiple axes threshold set

by kzoon

HTML

<script src="https://github.highcharts.com/feature/alignthresholds/highcharts.js"></script>

<figure class="highcharts-figure">
    <div id="container"></div>
    <p class="highcharts-description">
        Chart showing use of multiple y-axes, where each series has a separate
        axis. Multiple axes allows data in different ranges to be visualized
        together. While this in some cases can cause charts to be hard to read,
        it can also be a powerful tool to illustrate correlations. 
    </p>
</figure>

CSS

#container {
    height: 400px;
}

.highcharts-figure,
.highcharts-data-table table {
    min-width: 310px;
    max-width: 800px;
    margin: 1em auto;
}

.highcharts-data-table table {
    font-family: Verdana, sans-serif;
    border-collapse: collapse;
    border: 1px solid #ebebeb;
    margin: 10px auto;
    text-align: center;
    width: 100%;
    max-width: 500px;
}

.highcharts-data-table caption {
    padding: 1em 0;
    font-size: 1.2em;
    color: #555;
}

.highcharts-data-table th {
    font-weight: 600;
    padding: 0.5em;
}

.highcharts-data-table td,
.highcharts-data-table th,
.highcharts-data-table caption {
    padding: 0.5em;
}

.highcharts-data-table thead tr,
.highcharts-data-table tr:nth-child(even) {
    background: #f8f8f8;
}

.highcharts-data-table tr:hover {
    background: #f1f7ff;
}

JavaScript

Highcharts.chart('container', {
    chart: {
        zoomType: 'xy',
        alignThresholds: true
    },
    xAxis: {
        crosshair: true
    },
    yAxis: [{ // Primary yAxis
        crosshair: true,
        labels: {
            format: '{value}°C',
            style: {
                color: Highcharts.getOptions().colors[0]
            }
        },
        title: {
            text: 'Celcius',
            style: {
                color: Highcharts.getOptions().colors[0]
            }
        },
        plotLines: [{
                color: '#000',
                width: 2,
                value: 0,
                zIndex:2
        }]
    }, { // Secondary yAxis
        crosshair: true,
        title: {
            text: 'Farenhite',
            style: {
                color: Highcharts.getOptions().colors[3]
            }
        },
        labels: {
            format: '{value}°F',
            style: {
                color: Highcharts.getOptions().colors[3]
            }
        },
        opposite: true
    }],
    tooltip: {
        shared: true
    },
    series: [{
        name: 'Celcius',
        type: 'line',
        threshold:0,
        yAxis: 0,
        data: [-30, -20, -10, 0, 10, 20, 30, 40]

    }, {
        name: 'Farenhite',
        type: 'line',
         threshold:0,
        yAxis: 1,
        color: Highcharts.getOptions().colors[3],
        data: [-22, -4, 14, 32, 50, 68, 86, 104]
    }]
});