             borderWidth: 0.5,
             highlightedBorderWidth: 4,
             majorGridlineColor: NSColor(white: 0.7, alpha: 1),
-            majorGridlineWidth: 0.75,
+            majorGridlineParams: LineParams(lineWidth: 0.75),
             minorGridlineColor: NSColor(white: 0.7, alpha: 1),
-            minorGridlineWidth: 0.5,
+            minorGridlineParams: LineParams(lineWidth: 0.5, dash: [6, 3]),
             scaleFont: NSFont(name: "Helvetica-Light", size: 24)!,
             legendFont: NSFont(name: "Menlo", size: 20)!,
             legendColor: NSColor.white,
             legendPadding: 8,
-            lineWidth: 8,
+            lineParams: LineParams(lineWidth: 8),
             shadowRadius: 3,
             xPadding: 12)
 
-        func gridlineParams(for gridline: Gridline) -> (lineWidth: CGFloat, color: NSColor) {
-            switch gridline.kind {
+        func lineParams(for kind: Gridline.Kind) -> (color: NSColor, params: LineParams) {
+            switch kind {
             case .major:
-                return (majorGridlineWidth, majorGridlineColor)
+                return (majorGridlineColor, majorGridlineParams)
             case .minor:
-                return (minorGridlineWidth, minorGridlineColor)
+                return (minorGridlineColor, minorGridlineParams)
             }
         }
     }

            previousFrame = frame
        }

        // Draw vertical grid labels
        previousFrame = .null
        for gridline in verticalGridlines {
            guard let label = gridline.label else { continue }
            let xMid = chartBounds.minX + gridline.position * chartBounds.width
            let yTop = chartBounds.minY - 3

            let bounds = (label as NSString).boundingRect(with: largeSize, options: [], attributes: scaleAttributes)
            let pos = CGPoint(x: xMid - bounds.width / 2, y: yTop - bounds.height)
            let frame = bounds.offsetBy(dx: pos.x, dy: pos.y).insetBy(dx: -3, dy: 0)
            guard !previousFrame.intersects(frame) else { continue }
            (label as NSString).draw(at: pos, withAttributes: scaleAttributes)
            previousFrame = frame
        }

        // Draw border

        NSGraphicsContext.saveGraphicsState()
        NSRectClip(chartBounds)
        for gridline in horizontalGridlines {
            let path = NSBezierPath()
            path.move(to: CGPoint(x: 0, y: gridline.position))
            path.line(to: CGPoint(x: 1, y: gridline.position))
            path.transform(using: chartTransform)
            let (color, lineParams) = p.lineParams(for: gridline.kind)
            lineParams.apply(on: path)
            color.setStroke()
            path.stroke()
        }
        NSGraphicsContext.restoreGraphicsState()
