-
Notifications
You must be signed in to change notification settings - Fork 20
/
VerticalChartView.m
executable file
·68 lines (53 loc) · 2.93 KB
/
VerticalChartView.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//******************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2019. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// VerticalChartView.m is part of the SCICHART® Examples. Permission is hereby granted
// to modify, create derivative works, distribute and publish any part of this source
// code whether for commercial, private or personal use.
//
// The SCICHART® examples are distributed in the hope that they will be useful, but
// without any warranty. It is provided "AS IS" without warranty of any kind, either
// expressed or implied.
//******************************************************************************
#import "VerticalChartView.h"
#import "SCDDataManager.h"
@implementation VerticalChartView
- (Class)associatedType { return SCIChartSurface.class; }
- (BOOL)showDefaultModifiersInToolbar { return NO; }
- (void)initExample {
id<ISCIAxis> xAxis = [SCINumericAxis new];
xAxis.axisAlignment = SCIAxisAlignment_Left;
xAxis.axisTitle = @"X-Axis";
id<ISCIAxis> yAxis = [SCINumericAxis new];
yAxis.axisAlignment = SCIAxisAlignment_Top;
yAxis.axisTitle = @"Y-Axis";
SCIXyDataSeries *dataSeries0 = [[SCIXyDataSeries alloc] initWithXType:SCIDataType_Double yType:SCIDataType_Double];
SCIXyDataSeries *dataSeries1 = [[SCIXyDataSeries alloc] initWithXType:SCIDataType_Double yType:SCIDataType_Double];
SCDDoubleSeries *doubleSeries = [[SCDDoubleSeries alloc] initWithCapacity:20];
[SCDDataManager setRandomDoubleSeries:doubleSeries count:20];
[dataSeries0 appendValuesX:doubleSeries.xValues y:doubleSeries.yValues];
[doubleSeries.xValues clear];
[doubleSeries.yValues clear];
[SCDDataManager setRandomDoubleSeries:doubleSeries count:20];
[dataSeries1 appendValuesX:doubleSeries.xValues y:doubleSeries.yValues];
SCIFastLineRenderableSeries *lineSeries0 = [SCIFastLineRenderableSeries new];
lineSeries0.dataSeries = dataSeries0;
lineSeries0.strokeStyle = [[SCISolidPenStyle alloc] initWithColorCode:0xFF47bde6 thickness:2.0];
SCIFastLineRenderableSeries *lineSeries1 = [SCIFastLineRenderableSeries new];
lineSeries1.dataSeries = dataSeries1;
lineSeries1.strokeStyle = [[SCISolidPenStyle alloc] initWithColorCode:0xFF68bcae thickness:2.0];
[SCIUpdateSuspender usingWithSuspendable:self.surface withBlock:^{
[self.surface.xAxes add:xAxis];
[self.surface.yAxes add:yAxis];
[self.surface.renderableSeries add:lineSeries0];
[self.surface.renderableSeries add:lineSeries1];
[self.surface.chartModifiers add:[SCDExampleBaseViewController createDefaultModifiers]];
[SCIAnimations sweepSeries:lineSeries0 duration:3.0 andEasingFunction:[SCICubicEase new]];
[SCIAnimations sweepSeries:lineSeries1 duration:3.0 andEasingFunction:[SCICubicEase new]];
}];
}
@end