     }
     
     required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
+        orientation = .null
+        
+        super.init(coder: aDecoder)
+        self.backgroundColor = UIColor.clear
+        
+        let h = self.frame.size.height
+        let w = self.frame.size.width
+        
+        orientation = w > h ? .horizontal : .vertical
+        switch orientation {
+        case .horizontal:
+            length = w
+            breadth = h
+        case .vertical:
+            length = h
+            breadth = w
+        default:
+            length = w
+            breadth = h
+        }
     }
     
     override func draw(_ rect: CGRect) {

        case .vertical:
            length = h
            breadth = w
        }
        
        super.init(frame: frame)

    enum Orientation {
        case horizontal
        case vertical
        case null
    }
    
    /// The dominant color of each segment. Defaults to red.
    var fillColor: UIColor = UIColor.red {
