【问题标题】:Draw dynamic spider chart with bezier path用贝塞尔路径绘制动态蜘蛛图
【发布时间】:2021-04-08 12:09:28
【问题描述】:

你可以看到图片,我想用不同的部分画一个像这样的自定义蜘蛛图。这是一个带有动态部分的动态蜘蛛图,我想根据我的 api 数据为不同的部分着色,我该如何实现?

【问题讨论】:

    标签: swift xcode graph uibezierpath spider-chart


    【解决方案1】:

    您可以为此使用 UIBezierPath。我认为圈子很清楚。对于不同颜色的段,您可以使用函数bezierPathWithArcCenter:radius:startAngle:endAngle:clockwise: (https://developer.apple.com/documentation/uikit/uibezierpath/1624358-bezierpathwitharccenter) 并将其填充为所需的颜色。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-15
      • 2011-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-19
      • 2015-02-23
      • 2013-12-30
      相关资源
      最近更新 更多