             return "\"green\""
         case .transparent:
             return "\"transparent\""
+        case let .linearGradient(x0, y0, x2, y2, colors, absolute):
+            var result = "null"
+            if colors.count > 0 {
+                result = "new echarts.graphic.LinearGradient(\(x0), \(y0), \(x2), \(y2), ["
+                for color in colors {
+                    if color.jsonString != "null" {
+                        result += "\(color.jsonString),"
+                    }
+                }
+                result = result.substringToIndex(result.endIndex.predecessor())
+                result += "], \(absolute))"
+            }
+            return result
         case let .array(colors):
             var result = "["
-            for color in colors {
-                result += "\(color.jsonString)" + ","
+            if colors.count > 0 {
+                for color in colors {
+                    result += "\(color.jsonString)" + ","
+                }
+                result = result.substringToIndex(result.endIndex.predecessor())
             }
-            result = result.substringToIndex(result.endIndex.predecessor())
             result += "]"
             return result
         case let .image(base64Str, r):

    case hexColor(String)
    case array([SECColor])
    case image(String, ImageRepeat)
//    case linearGradient(Float, Float, Float, Float, )
    case auto, red, blue, green, yellow, transparent
    
    public var jsonString: String {

    }
}

public struct SECGradientColorElement {
    private var offset: Float?
    private var color: SECColor?
    
    public init() { }
    
    public init(_ offset: Float, _ color: SECColor) {
        self.offset = offset
