y通道type=log报错
#5181
-
代码 import { Chart } from "@antv/g2";
const chart = new Chart({ container: "container" });
chart.options({
type: "interval",
theme: "classic",
autoFit: true,
data: {
type: "fetch",
value:
"https://gw.alipayobjects.com/os/bmw-prod/fb9db6b7-23a5-4c23-bbef-c54a55fee580.csv",
},
encode: { x: "letter", y: "frequency" },
scale: { y: { type: "log" } },
axis: { y: { labelFormatter: ".0%" } },
});
chart.render(); |
Beta Was this translation helpful? Give feedback.
Answered by
pearmini
Jun 25, 2023
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
经过排查,这个不是 bug。上面例子中的 y1 为
[0, 0, 0, ..., 0]
,而 log 比例尺无法映射 0。如果真的希望使用 log 比例尺,可以修改 y1 为接近 0 的值,如下: