We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用facetRect() 做横向排列的对比直方图时,从第二个直方图起无法去掉Y轴label,而且Color 标题不能取消,目的是为了节省视图空间。在制造行业,为了做设备之间工艺参数性能对比,横向排列的对比直方图 (也就是直方图的每一个长方格与X轴平行)非常有用。
https://g2.antv.antgroup.com/examples/analysis/bin/#binx
进入 https://g2.antv.antgroup.com/examples/analysis/bin/#binx , 使用如下代码 import { Chart } from "@antv/g2"; const chart = new Chart({ container: "container", paddingTop: 60, });
const facet = chart .facetRect() // .data({ type: "fetch", value: "https://gw.alipayobjects.com/os/antvdemo/assets/data/scatter.json", }) .encode("x", "gender");
facet .rect() .encode("x", "height") .encode("color", "gender") .coordinate({ transform: [{ type: "transpose" }] }) .transform({ type: "binX", y: "count" }) .transform({ type: "stackY" }) .scale("y", { nice: true }) .axis({x:{title:false,label:true},y:{label:true}}) .attr("frame", false) .style("insetBottom", 1); // 将 "insetLeft" 改为 "insetBottom"
chart.render();
去掉红色划X的部分文字
import { Histogram } from '@ant-design/plots'; ,import { Histogram } from '@ant-design/plots'; ant-design/plots Histogram 没法水平排列,也就是直方图的每一个长方格与X轴平行
The text was updated successfully, but these errors were encountered:
const facet = chart .facetRect() // .data({ type: "fetch", value: "https://gw.alipayobjects.com/os/antvdemo/assets/data/scatter.json", }) .encode("x", "gender") .axis('x',{title:null});
可以隐藏gender
Sorry, something went wrong.
No branches or pull requests
问题描述
使用facetRect() 做横向排列的对比直方图时,从第二个直方图起无法去掉Y轴label,而且Color 标题不能取消,目的是为了节省视图空间。在制造行业,为了做设备之间工艺参数性能对比,横向排列的对比直方图 (也就是直方图的每一个长方格与X轴平行)非常有用。
重现链接
https://g2.antv.antgroup.com/examples/analysis/bin/#binx
重现步骤
进入 https://g2.antv.antgroup.com/examples/analysis/bin/#binx , 使用如下代码 import { Chart } from "@antv/g2";
const chart = new Chart({
container: "container",
paddingTop: 60,
});
const facet = chart
.facetRect() //
.data({
type: "fetch",
value: "https://gw.alipayobjects.com/os/antvdemo/assets/data/scatter.json",
})
.encode("x", "gender");
facet
.rect()
.encode("x", "height")
.encode("color", "gender")
.coordinate({ transform: [{ type: "transpose" }] })
.transform({ type: "binX", y: "count" })
.transform({ type: "stackY" })
.scale("y", { nice: true })
.axis({x:{title:false,label:true},y:{label:true}})
.attr("frame", false)
.style("insetBottom", 1); // 将 "insetLeft" 改为 "insetBottom"
chart.render();
预期行为
去掉红色划X的部分文字
平台
屏幕截图或视频(可选)
补充说明(可选)
import { Histogram } from '@ant-design/plots'; ,import { Histogram } from '@ant-design/plots'; ant-design/plots Histogram 没法水平排列,也就是直方图的每一个长方格与X轴平行
The text was updated successfully, but these errors were encountered: