-
Notifications
You must be signed in to change notification settings - Fork 0
/
PNGenericChart.swift
executable file
·54 lines (47 loc) · 1.19 KB
/
PNGenericChart.swift
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
//
// PNGenericChart.swift
// PNChartSwift
//
// Created by YiChen Zhou on 12/27/16.
// Copyright © 2016 YiChen Zhou. All rights reserved.
//
import UIKit
class PNGenericChart: UIView {
var hasLegend: Bool!
var legendPosition: PNLegendPosition!
var legendStyle: PNLegendItemStyle!
var legendFont: UIFont!
var legendFontColor: UIColor!
var labelRowsInSerialMode: Int!
var displayAnimation: Bool!
func setupDefaultValues() {
hasLegend = true
legendPosition = .Bottom
legendStyle = .Stacked
labelRowsInSerialMode = 1
displayAnimation = true
}
func getLegendWIthMaxWidth(maxWidth: Float) -> UIView! {
//self.doesNotRecognizeSelector(_cmd)
return nil
}
func setLabelRowsInSerialMode(num: Int) {
if legendStyle == .Serial {
labelRowsInSerialMode = num
} else {
labelRowsInSerialMode = 1
}
}
}
extension PNGenericChart {
enum PNLegendPosition: Int {
case Top = 0
case Bottom = 1
case Left = 2
case Right = 3
}
enum PNLegendItemStyle: Int {
case Stacked = 0
case Serial = 1
}
}