很难让两个具有相同x和y值的数据点像堆叠coltumn图表类型一样,即彼此之间



i具有以下数据的示例,某些点具有相同的x,y值,这意味着它们在列表中彼此覆盖的列图中 - 有没有办法让它们出现在彼此的顶部像堆叠冠图中的类型。

请参阅工作示例:http://jsfiddle.net/yjxolr9e/

JSON数据的部分:

"purchaseRows": [
{x: new Date("2017-03-10"), y:600},
{x: new Date("2017-04-06"), y:504},
{x: new Date("2017-04-06"), y:600},
{x: new Date("2017-05-03"), y:504},
{x: new Date("2017-05-03"), y:504},
{x: new Date("2017-06-05"), y:504},
{x: new Date("2017-08-07"), y:714},
{x: new Date("2017-09-04"), y:714},
{x: new Date("2017-10-02"), y:504},
{x: new Date("2017-11-06"), y:504},
{x: new Date("2017-12-04"), y:540},
],

和数据数组:

data: [     { type: "stepLine", showInLegend: true, lineThickness: 2, name: "Transactions", markerSize: 5, markerType: "circle", color: "SteelBlue", dataPoints: json.transactionData },
                    { type: "stepLine", lineDashType: "dot", showInLegend: true, lineThickness: 2, name: "Stock forecast", markerSize: 5, markerType: "circle", color: "SteelBlue", dataPoints: json.stockForecast },
                    { type: "stackedColumn", showInLegend: true, lineThickness: 0, name: "Backlog", markerSize: 8, markerType: "circle", color: "coral", dataPoints: json.currentbacklog },
                    { type: "stackedColumn", showInLegend: true, lineThickness: 0, name: "Demand", markerSize: 8, markerType: "circle", color: "red", dataPoints: json.unconsumedFcst },
                    { type: "line", showInLegend: true, lineThickness: 0, name: "Stock", markerSize: 8, markerType: "circle", color: "red", dataPoints: json.currentStock },
                    { type: "column", showInLegend: true, lineThickness: 2, name: "Purchase rows", markerSize: 8, markerType: "circle", color: "lightgreen", dataPoints: json.purchaseRows }
        ],

beevk是正确的图表类型stackedColumn dors the Trick。

最新更新