我想使用 HighCharts 渲染直方图/折线图。我不想对系列使用的数组进行硬编码。我希望渲染的数据在对象显示中,如下所示:
0: ○, 107983, 1: 1, 347923, 2: 2, 182329, . . .
我的代码在这里:
function RenderChart(display) {
    myDisplay = display;
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'line'
        },
        title: {
            text: 'Metric histogram'
        },
        xAxis: {
            //categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
            minPadding: 0.05,
            maxPadding: 0.05
        },
        plotOptions: {
            line: {
                animation: false
            },
            column: {
                groupPadding: 0,
                pointPadding: 0,
                borderWidth: 0
            }
        },
        series: [{
            data: [myDisplay]
        }]
    });
};
这不会呈现折线图。它呈现一个空图表。