0

I would like to change drawDirection property in donut chart

Please see this: https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiCharts/2.8.7/Standard/Normal/html/Classes/SChartDonutSeries.html

this is part of the code I am referring to:

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

this is my code:

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

How can I do that in swift 3?

Besat
  • 1,428
  • 13
  • 27

2 Answers2

1

DISCLAIMER I am a developer at ShinobiControls.

You can set the draw direction of your pie or donut series in Swift 3 with the following code:

pieSeries.drawDirection = .clockwise

Make sure you are using the latest version of our framework (which is currently 2.9.3).

Let me know if you have any questions.

MrAPolk
  • 116
  • 2
0

I figured out that I can set it like this:

donutSeries.drawDirection = SChartRadialSeriesDrawDirection(rawValue: 1)!

If there is any better way to do it please let me know.

Besat
  • 1,428
  • 13
  • 27