jQuery - 图表仅显示 1 个图表

jQuery - Flot chart only shows 1 graph

这是我拥有的数据(由 2 个图表表示的 2 个对象的数组)

[{"label":"Estimated Profit","color":"#4572A7","lines":{"show":true,"lineWidth":4},"points":{"show":true,"radius":4},"data":[[1443628800000,"29.00"],[1441036800000,"33.55"],[1438358400000,"32.55"],[1435680000000,"32.37"],[1433088000000,"35.12"],[1430409600000,"29.74"],[1427817600000,"36.00"],[1425139200000,"33.93"],[1422720000000,"31.37"],[1420041600000,"30.13"],[1417363200000,"31.09"],[1414771200000,"30.51"]]},{"label":"Actual Profit","color":"#AA4643","lines":{"show":true,"lineWidth":4},"points":{"show":true,"radius":4},"data":[[1443628800000,"29.00"],[1441036800000,"33.55"],[1438358400000,"32.55"],[1435680000000,"32.37"],[1433088000000,"35.12"],[1430409600000,"29.74"],[1427817600000,"36.00"],[1425139200000,"33.93"],[1422720000000,"31.37"],[1420041600000,"30.13"],[1417363200000,"31.09"],[1414771200000,"30.51"]]}]

和非常普通的Flot's plot函数调用

$.plot($("#Profits"), profit_data, {
    lines: {
        show: true
    },
    legend: {
        show: true
    },
    points: {
        show: true
    },
    grid: {
        show: true,
        hoverable: true,
        clickable: false,
        borderColor: '#cccccc'
    },
    xaxis: {
        min: (new Date(data.min)).getTime(),
        max: (new Date(data.max)).getTime(),
        mode: "time",
        timeformat: "%b",
        tickSize: [1, "month"],
        monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
        tickLength: 0, // hide gridlines
        axisLabel: 'Month',
        axisLabelUseCanvas: true,
        axisLabelFontSizePixels: 12,
        axisLabelFontFamily: 'Verdana, Arial, Helvetica, Tahoma, sans-serif',
        axisLabelPadding: 5
    },
    yaxis: {
        axisLabel: 'Profits (%)',
        axisLabelUseCanvas: true,
        axisLabelFontSizePixels: 12,
        axisLabelFontFamily: 'Verdana, Arial, Helvetica, Tahoma, sans-serif',
        axisLabelPadding: 5
    }
});

但由于某种原因它只绘制了 1 个图表,即使图例框显示有 2 个图表。见照片:

我在这里错过了什么?

两个数据点相同。

[[1443628800000,"29.00"],[1441036800000,"33.55"],[1438358400000,"32.55"],[1435680000000,"32.37"],[1433088000000,"35.12"],[1430409600000,"29.74"],[1427817600000,"36.00"],[1425139200000,"33.93"],[1422720000000,"31.37"],[1420041600000,"30.13"],[1417363200000,"31.09"],[1414771200000,"30.51"]]
[[1443628800000,"29.00"],[1441036800000,"33.55"],[1438358400000,"32.55"],[1435680000000,"32.37"],[1433088000000,"35.12"],[1430409600000,"29.74"],[1427817600000,"36.00"],[1425139200000,"33.93"],[1422720000000,"31.37"],[1420041600000,"30.13"],[1417363200000,"31.09"],[1414771200000,"30.51"]]

Estimated Profit 线与 Actual Profit 重叠,因此不可见。检查您正在生成的数据。