简体   繁体   中英

HighChart doesn't output anything

I am using HighChart to draw a graph, but it doesn't print out anything I have check the 'data' array that is passed and there seems to be nothing wrong with it

my code looks like this:

var high = []; //data

$.each(data.getHighValue, function (key, value) {
    high.push(value.High);
});

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'line',
            marginRight: 130,
            marginBottom: 25
        },
        title: {
            text: 'Weekyly Data',
            x: -20 //center
        },
        subtitle: {
            text: 'From Arp 1st ro Apr 15th',
            x: -20
        },
        xAxis: {
            categories: ['Mon', 'Tues', 'Weds', 'Thurs', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            title: {
                text: 'Blood Level (unit)'
            },
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }]
        },
        tooltip: {
            valueSuffix: 'unit'
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'top',
            x: -10,
            y: 100,
            borderWidth: 0
        },
        series: [{
            name: 'High Blood Level',
            data: high
        }]
    });
});

My 'high' array has these values: 113, 114, 115, 116, 117, 115, 127

You probably loaded jQuery after Highcharts. It needs to be loaded before Highcharts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM