Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 高图、堆叠列、开关行和列_Javascript_Highcharts - Fatal编程技术网

Javascript 高图、堆叠列、开关行和列

Javascript 高图、堆叠列、开关行和列,javascript,highcharts,Javascript,Highcharts,我希望能够在我的分组、时间/优先级之间切换。我有一张堆积柱形图。可以选择这样做。但它似乎只适用于表中已有的数据,我将数据作为JSON引入 我的javascript是: var chart_ops_support_times = new Highcharts.Chart({ chart: { renderTo: 'chart_ops_support_times', type: 'column' }, title: { te

我希望能够在我的分组、时间/优先级之间切换。我有一张堆积柱形图。可以选择这样做。但它似乎只适用于表中已有的数据,我将数据作为JSON引入

我的javascript是:

  var chart_ops_support_times = new Highcharts.Chart({
    chart: {
        renderTo: 'chart_ops_support_times',
        type: 'column'
    },
    title: {
        text: '',
        align: 'left'
    },
    subtitle: {
        text: ' '
    },
    xAxis: {
        categories: [
            'one hour','2 hours','4 hours',
            '8 hours','one day','2 days',
            'one week','> one week'
        ]
    },
    yAxis: {
        min: 0,
        title: {
            text: 'counts'
        }
    },
    legend: {
        align: 'left',
        verticalAlign: 'top',
        floating: true,
        borderColor: '#CCC',
        borderWidth: 1,
        shadow: false,
        symbolHeight: 10,
        symbolWidth: 10

    },
    tooltip: {
        formatter: function () {
            return "<b>" + this.x + "</b><br/>" +
                this.series.name + ': ' + this.y + "<br/>" +
                'Total: ' + this.point.stackTotal;
        }
    },
    plotOptions: {
        column: {
            stacking: 'normal'
        }
    },
    credits: {
        enabled: false
    },
    exporting: {
        enabled: false
    },
    series: data
});

数据模块不能与JSON一起使用

数据模块提供了使用声明性选项集以方便的方式从外部源(如CSV文件、HTML表格或Google电子表格)加载数据的选项。

不必为此使用数据模块,您可以从JSON解析数据以某种方式使用

另一个选项是使用JSON中的数据创建隐藏的HTML表,然后将Highcharts与数据模块和使用表一起使用