我想在圆环图中更改drawDirection属性
这是我所指的代码的一部分:
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中做到这一点?
答案 0 :(得分:1)
免责声明我是ShinobiControls的开发人员。
您可以使用以下代码在Swift 3中设置饼图或甜甜圈系列的绘制方向:
pieSeries.drawDirection = .clockwise
确保您使用的是我们框架的最新版本(目前为2.9.3)。
如果您有任何问题,请与我们联系。
答案 1 :(得分:0)
我发现我可以这样设置:
donutSeries.drawDirection = SChartRadialSeriesDrawDirection(rawValue: 1)!
如果有更好的方法,请告诉我。