Shinobi 图表甜甜圈系列:如何更改 drawDirection?

Shinobi chart donut series: How to change drawDirection?

我想更改圆环图中的 drawDirection 属性

请看这个:https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiCharts/2.8.7/Standard/Normal/html/Classes/SChartDonutSeries.html

这是我所指代码的一部分:

typedef NS_ENUM(NSInteger, SChartRadialSeriesDrawDirection) {
    SChartRadialSeriesDrawDirectionAntiClockwise,
    SChartRadialSeriesDrawDirectionClockwise
};

@interface SChartDonutSeries : SChartRadialSeries
#pragma mark -
#pragma mark Drawing the series
/** @name Drawing the series */

/** The direction in which data is drawn around the centre of the plot.

 - SChartRadialSeriesDrawDirectionClockwise: Configures the direction in which the data is drawn around the center of the plot to be clockwise.
 - SChartRadialSeriesDrawDirectionAntiClockwise: Configures the direction in which the data is drawn around the center of the plot to be anticlockwise.

 This defaults to `SChartRadialSeriesDrawDirectionAntiClockwise`.
 */
@property (nonatomic) SChartRadialSeriesDrawDirection drawDirection;
@end

这是我的代码:

let donutSeries = SChartDonutSeries()
donutSeries.drawDirection = SChartRadialSeriesDrawDirection.SChartRadialSeriesDrawDirectionClockwise

如何在 swift 3 中做到这一点?

我发现我可以这样设置:

donutSeries.drawDirection = SChartRadialSeriesDrawDirection(rawValue: 1)!

如果有更好的方法,请告诉我。

免责声明我是 ShinobiControls 的开发人员。

您可以使用以下代码在 Swift3 中设置饼图或甜甜圈系列的绘制方向:

pieSeries.drawDirection = .clockwise

确保您使用的是我们框架的最新版本(当前为 2.9.3)。

如果您有任何问题,请告诉我。