This question for creating the Highcharts Donut chart with multiple series.
(用于创建具有多个系列的Highcharts Donut图表的问题。)
I have dynamic key properties xData, yData
of JSON input data model:
(我有JSON输入数据模型的动态键属性xData, yData
:)
xData= ["Phase", "Step", "Task"];
yData = ["VPhase", "VStep", "Value"]
inputArray = [
{ Phase: "Phase 1", VPhase: 100, Step: "Step 1", VStep:50, Task: "Task 1", VTask: 20 },
{ Phase: "Phase 1", VPhase: 100, Step: "Step 1", VStep:50, Task: "Task 2", VTask: 30 },
{ Phase: "Phase 1", VPhase: 100, Step: "Step 2", VStep:50, Task: "Task 1", VTask: 25 },
{ Phase: "Phase 1", VPhase: 100, Step: "Step 2", VStep:50, Task: "Task 2", VTask: 25 },
{ Phase: "Phase 2", VPhase: 150, Step: "Step 1", VStep:100,Task: "Task 1", VTask: 60 },
{ Phase: "Phase 2", VPhase: 150, Step: "Step 1", VStep:100,Task: "Task 2", VTask: 40 },
{ Phase: "Phase 2", VPhase: 150, Step: "Step 2", VStep:50, Task: "Task 1", VTask: 15 },
{ Phase: "Phase 2", VPhase: 150, Step: "Step 2", VStep:50, Task: "Task 2", VTask: 35 }
];
I need group and distinct consecutive index xData, yData
for creating output result similar:
(我需要组和不同的连续索引xData, yData
来创建类似的输出结果:)
outputArray = [
{
Phase: ["Phase 1", "Phase 2"],
VPhase: [100, 150]
},
{
Step: ["Step 1", "Step 2", "Step 1", "Step 2"],
VStep: [50, 50, 100 ,50]
},
{
Task: ["Task 1", "Task 2", "Task 1", "Task 2", "Task 1", "Task 2", "Task 1", "Task 2"],
VTask: [20, 30, 25, 25, 60, 40, 15, 35]
}
];
ask by Moslem Shahsavan translate from so