We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
下面是我的代码,我希望可以自定义我的y轴的domain,我在设置甘特图和折线图时,均运行无误,但是当我设置column/bar这种类型的图标时,它的底端超过了坐标轴的范围。应该如何解决这一问题?
var chart = new G2.Chart({ container: "container", }); function changechart() { chart.clear(); ChartScript(); chart.render(); } function ChartScript() { var mydata=[ { item: "a1", value: 9.1, type: "actualvalue"}, { item: "a1", value: 0.2, type: "value" }, { item: "a2", value: 9.3, type: "actualvalue"}, { item: "a2", value: 0.4, type: "value" }, ] var data=mydata; var datatrue=[]; var colorStr=[]; data.forEach(function(itemold) { if(itemold.hasOwnProperty('color')) { if(datatrue.some(item => item.type === itemold["type"])==false ) { colorStr.push([itemold["type"],itemold["color"]]); } } datatrue.push({"item":itemold["item"],"type":itemold["type"],"value":itemold["value"]}); }) chart.data(datatrue); chart.options({ type: "interval", theme: "classic", autoFit: true, padding:80, encode: { x: 'item', y: "value", color: "type" }, transform: [{ type: "stackY" }], scale: {y:{domain:[9,10]},'color':{relations: colorStr}}, axis: { x: { title: false} , y: { title: "Unit", titlePosition:'top'} }, tooltip: { title:"type",items: [{ field: 'value' }] }, legend: { color: { title: false,position:'bottom',layout: { justifyContent: 'center'} },} }); } changechart();
No response
The text was updated successfully, but these errors were encountered:
chart.options({ scale: { y: { domain: [9, 10], clamp: true, // 新增这一行 }, }, });
Sorry, something went wrong.
No branches or pull requests
问题描述
下面是我的代码,我希望可以自定义我的y轴的domain,我在设置甘特图和折线图时,均运行无误,但是当我设置column/bar这种类型的图标时,它的底端超过了坐标轴的范围。应该如何解决这一问题?
重现链接
No response
重现步骤
No response
预期行为
No response
平台
屏幕截图或视频(可选)
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: