Highcharts Demo

author(s): Torstein Hønsi

HTML

<script src="http://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 400px; width: 500px"></div>

CSS

.hc-label {
    background-color: red;
    padding: 0px 5px;
    color: yellow;
}

JavaScript

$(function () {

    
    var data=[[28,0],[24,3],[16,10]];
   var param= {
WodTag: "cur_spd",
Name: "Current speed",
Color: "#C6C6C6	",
LineStyle: "Solid",
SeriesType: "line",
LineWidth: 2,
TickInterval: null,
MinValue: null,
MaxValue: null,
Decimals: 2
};
    
    $('#container').highcharts({
            chart: {
                height: 700,
                width: 400,
                plotBorderWidth: 1,
                plotBorderColor: '#E4E4E4',
            },
            xAxis: {
                title: {
                    useHTML: true,
                    text: param.Name + "( m/s  )",
                },
                gridLineWidth: 1,
                min: param.MinValue,
                max: param.MaxValue,
                gridLineDashStyle: 'Dot',
                tickInterval: param.TickInterval
            },
            yAxis: {
                title: {
                    text: 'Depth(m)',
                },
                reversed: true,
                tickLength: 50,
                gridLineDashStyle: 'Dot'
            },
            title: {
                text: null,
            },
            legend: {
                enabled: false
            },
            credits: {
                enabled: false
            },
            tooltip: {
                useHTML: true,
                formatter: function () {
                    return this.y;
                }
            },
            series: [{
                name: param.Name,
                data: data,
                color: param.Color,
                dashStyle: param.LineStyle,
                lineWidth: param.LineWidth,
                type: "line"
            }]
        });
});