首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Victory.js取图的四舍五入边

从Victory.js取图的四舍五入边
EN

Stack Overflow用户
提问于 2022-06-29 21:34:44
回答 1查看 35关注 0票数 0

不确定这里是否有人熟悉Victory.js框架,但我正在尝试创建一个带圆角的堆叠条。除了圆形的边缘,我什么都有,我似乎找不出它们。这是我的代码:

代码语言:javascript
复制
import React from "react";
import { render } from "react-dom";
import { VictoryStack, VictoryBar } from "victory";

const Chart = () => {
  return (
    <VictoryStack
      horizontal
      style={{
        data: { stroke: "white", strokeWidth: 3, width: 30 }
      }}
      colorScale={["#9e62c0", "#bc95d4", "#44c973", "#f9c63d", "#f5a000"]}
    >
      <VictoryBar data={[{ x: "c", y: 0.5 }]} />
      <VictoryBar data={[{ x: "c", y: 1 }]} />
      <VictoryBar data={[{ x: "c", y: 5.2 }]} />
      <VictoryBar data={[{ x: "c", y: 2.3 }]} />
      <VictoryBar data={[{ x: "c", y: 1 }]} />
    </VictoryStack>
  );
};

render(<Chart />, document.getElementById("root"));
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-30 13:02:30

我想出了怎么做。我为每个酒吧的每个角落添加了以下内容:

代码语言:javascript
复制
cornerRadius={{bottomLeft:(4), bottomRight:(4), topLeft:(4), topRight:(4)}}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72808129

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档