gpt4 book ai didi

charts - ExtJS 图表标签问题

转载 作者:行者123 更新时间:2023-12-01 02:13:53 25 4
gpt4 key购买 nike

我有一个 cartesian具有多个系列的图表。一个系列是条形图,另一个系列是线条。线轴标签未呈现与为线输入的数据相对应的正确值。

例如我的商店数据如下:

{
"agg_fq": "2013 - FQ1",
"quarterly_sum": 12748,
"dys": 92,
"avg_per_day": 138
}, {
"agg_fq": "2013 - FQ2",
"quarterly_sum": 12161,
"dys": 90,
"avg_per_day": 135
}, {
"agg_fq": "2013 - FQ3",
"quarterly_sum": 12410,
"dys": 91,
"avg_per_day": 136
}, {
"agg_fq": "2013 - FQ4",
"quarterly_sum": 12137,
"dys": 92,
"avg_per_day": 131
}, {
"agg_fq": "2014 - FQ2",
"quarterly_sum": 11970,
"dys": 90,
"avg_per_day": 133
}, {
"agg_fq": "2014 - FQ3",
"quarterly_sum": 9743,
"dys": 91,
"avg_per_day": 107
}, {
"agg_fq": "2014 - FQ4",
"quarterly_sum": 8294,
"dys": 92,
"avg_per_day": 90
}

为该线绘制的数据是 dys属性(property)。值介于 90 之间和 100但图表标签显示 0 - 1.0 .我试过查看 renderer标签,它显示相同的问题,并且值不正确。

这是我定义的图表:

{
xtype: 'cartesian',
store: store,
width: 400,
height: 400,
axes: [{
type: "category",
postion: "bottom",
fields: "agg_fq",
title: "Quarters",
label: {
rotate: {
degrees: -45
}
}
}, {
type: "numeric",
position: "right",
grid: true,
fields: ["avg_per_day"],
title: "Emails"
}, {
type: "numeric",
position: "left",
title: "Days in Qtr",
fields: ["dys"],
renderer: function(value) {
console.log(value);
}
}],
series: [{
type: "bar",
axis: "right",
xField: "agg_fq",
yField: ["avg_per_day"],
stacked: false
}, {
type: "line",
axis: "left",
xField: "agg_fq",
yField: ["dys"]

}]
}

这是一个 Sencha Fiddle with the issue .

最佳答案

弄乱代码后,我发现了问题。 yFieldline如果系列是数组,则显然会导致问题。将系列更改为以下内容将解决此问题:

{
type: "line",
axis: "left",
xField: "agg_fq",
yField: "dys"
}

这是一个 Sencha Fiddle with the fix .

关于charts - ExtJS 图表标签问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26767734/

25 4 0