为什么右边有空白?(Victory-Native)



为什么右边有空格?

如何去掉右边的空白?

有人能帮帮我吗?

我的代码

<VictoryChart domainPadding={10} width={width}>
<Defs>
<LinearGradient id="gradientStroke" x1="0%" y1="0%" x2="0%" y2="100%">
<Stop offset="0%" stopColor="#ff0974" />
<Stop offset="100%" stopColor="#ff5d00" />
</LinearGradient>
</Defs>
<VictoryAxis
tickValues={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]}
tickFormat={(x) => `${x}월`}
style={{
ticks: { stroke: "none" },
grid: { stroke: "transparent" },
}}
/>
<VictoryAxis
dependentAxis
tickValues={[0, 10000, 20000, 30000, 40000]}
tickFormat={(x: number) => `${x.toLocaleString()}`}
style={{
axis: { stroke: "none" },
ticks: { stroke: "none" },
grid: { stroke: "#ddd" },
}}
/>
<VictoryBar
data={sampleData}
x="month"
y="amount"
barWidth={5}
cornerRadius={{ top: 2.5, bottom: 2.5 }}
style={{ data: { fill: "url(#gradientStroke)" } }}
/>

resultImage

调整一下padding prop

填充道具指定图表边缘与任何呈现的子组件之间的填充量(以像素为单位)

https://formidable.com/open-source/victory/docs/common-props填充

相关内容

  • 没有找到相关文章

最新更新