gpt4 book ai didi

javascript - Kendo UI 数据可视化 : Comparing multiple line series (comparison line chart)

转载 作者:行者123 更新时间:2023-12-03 08:00:59 25 4
gpt4 key购买 nike

我需要像任何简单的比较折线图一样可视化计划和实际进度的差异。

我写道(Dojo Demo):

var plan = [
{ depth: 00, day: 0 },
{ depth: 50, day: 4 },
{ depth: 45, day: 11},
{ depth: 55, day: 16},
];
var actual = [
{ depth: 00, day: 0 },
{ depth: 55, day: 7 },
{ depth: 50, day: 11},
{ depth: 50, day: 13},
];
function createChart() {
$("#chart").kendoChart({
title: {
text: "Progress Comparision"
},
series: [{
name:"Plan",
type: "line",
data:plan,
field: "depth",
categoryField: "day"
},
{
name:"Actual",
type: "line",
data:actual,
field: "depth",
categoryField: "day"
}],
categoryAxis: {
justified: true,
categories: [0,5,10,15,20]
}
});
}

我得到了这个:

comparison line chart with problem

但我期望类似的东西:

expected comparison line chart

有什么想法吗?

最佳答案

系列类型应该是scatterLine而不是line:(Final Demo)

var plan = [
{ depth: 00, day: 0 },
{ depth: 50, day: 4 },
{ depth: 45, day: 11},
{ depth: 55, day: 16},
];
var actual = [
{ depth: 00, day: 0 },
{ depth: 55, day: 7 },
{ depth: 50, day: 11},
{ depth: 50, day: 13},
];
function createChart() {
$("#chart").kendoChart({
title: {
text: "Progress Comparision"
},
series: [{
name:"Plan",
type: "scatterLine",
data:plan,
yField: "depth",
xField: "day"
},
{
name:"Actual",
type: "scatterLine",
data:actual,
yField: "depth",
xField: "day"
}],
xAxis: {
justified: true,
max: 20,
}
});
}

关于javascript - Kendo UI 数据可视化 : Comparing multiple line series (comparison line chart),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34575189/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com