BTC-ETH Area

author(s): Askel Eirik Johansson

HTML

<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/offline-exporting.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>

<div id="container"></div>
<p class="highcharts-description">
    Dark-themed area chart showing the price of Bitcoin in Ethereum
</p>

CSS

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        "Apple Color Emoji",
        "Segoe UI Emoji",
        "Segoe UI Symbol",
        sans-serif;
    background: #000;
    color: #fff;
}

#container {
    height: 600px;
    min-width: 310px;
}

.highcharts-description {
    background: light-dark(#f2f6f2, #323232);
    border-radius: 0 4px 4px 0;
    border-left: 2px solid light-dark(#1d6aff, #fff);
    font-size: 0.8rem;
    font-style: italic;
    padding: 8px 16px;
    margin: 2em 10px 1em;
}

JavaScript

// Configuring the style of the chart
Highcharts.setOptions({
    lang: {
        rangeSelectorZoom: ''
    },

    chart: {
        backgroundColor: '#000000',
        zooming: {
            resetButton: {
                theme: {
                    fill: '#f23644',
                    stroke: 'none',
                    style: {
                        color: '#ffffff'
                    },
                    r: 8,
                    states: {
                        hover: {
                            style: {
                                color: '#000000'
                            }
                        }
                    }
                }
            }
        }
    },

    title: {
        style: {
            color: '#b0abab',
            fontSize: '2em'
        }
    },

    xAxis: {
        labels: {
            style: {
                color: '#b0abab'
            }
        }
    },

    yAxis: {
        labels: {
            style: {
                color: '#b0abab'
            }
        }
    },

    navigator: {
        series: {
            fillColor: {
                linearGradient: [0, 0, 0, 40],
                stops: [
                    [0, '#5c0d13'],
                    [1, '#000000']
                ]
            }
        },
        xAxis: {
            labels: {
                style: {
                    color: '#ffffff',
                    opacity: 1,
                    textOutline: '#000000'
                }
            }
        },
        maskFill: 'rgba(181, 145, 143, 0.2)',
        handles: {
            backgroundColor: '#5f5959',
            borderRadius: '50%',
            width: 20,
            height: 20
        }
    },

    exporting: {
        buttons: {
            contextButton: {
                symbolStroke: '#d9d7d7',
                theme: {
                    fill: '#000000',
                    states: {
                        hover: {
                            fill: '#000000'
             ...