0

我是 Highcharts 的新手,我已经喜欢它了。我使用 json、php en mysql 制作了一些柱形图(带有给定示例)。现在我想使用 json 制作一个带有列和一条线的图表。谁能告诉我应该怎么做?

$(function () {
var chart;
$(document).ready(function() {
    $.getJSON("DataKwhDagCum.php", function(json) {     
        chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                type: 'column',
                marginRight: 130,
                marginBottom: 25
            },
            title: {
                text: 'In (Enexis) vs Out (Zonnestroom)',
                x: -20 //center
            },
            subtitle: {
                text: '',
                x: -20
            },
            xAxis: {
                categories: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20','21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']
            },
            yAxis: {
                title: {
                    text: 'Amount'
                },
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            },
            tooltip: {
                formatter: function() {
                        return '<b>'+ this.series.name +'</b><br/>'+
                        this.x +': '+ this.y;
                }
            },
            legend: {
                layout: 'vertical',
                align: 'right',
                verticalAlign: 'top',
                x: -10,
                y: 100,
                borderWidth: 0
            },
            series: json
        });
    });

});

});
4

1 回答 1

0

你可以使用两种方式

于 2013-03-27T13:41:23.393 回答