             if value.ratio >= 0.1 {
                 let strx = cx + cos(midRadian) * radius * 0.5
                 let stry = cy + sin(midRadian) * radius * 0.5
-                let string = NSAttributedString(string: String(format: "%.1f%%", value.ratio * 100),
-                    attributes: [NSForegroundColorAttributeName: NSColor.whiteColor(), NSFontAttributeName: NSFont.systemFontOfSize(14)])
-                let line = CTLineCreateWithAttributedString(string)
+
+                let string: String
+                switch legendType {
+                case .Ratio:
+                    string = String(format: "%.1f%%", value.ratio * 100)
+                case .ApplicationName:
+                    string = value.legend
+                }
+
+                let attributedString = NSAttributedString(string: string, attributes: lineAttributes)
+                let line = CTLineCreateWithAttributedString(attributedString)
+                let truncatedLine = CTLineCreateTruncatedLine(line, lineWidth, .End, truncationToken)!
                 CGContextSetTextPosition(context, strx - 20, stry)
                 CGContextSaveGState(context)
                 CGContextSetShadow(context, CGSizeMake(1, 1), 5)
-                CTLineDraw(line, context)
+                CTLineDraw(truncatedLine, context)
                 CGContextRestoreGState(context)
             }
         }
     }
+
+    override func mouseDown(theEvent: NSEvent) {
+        let currentIndex = LegendType.values.indexOf(legendType)!
+        legendType = LegendType.values[(currentIndex + 1) % LegendType.values.count]
+    }
 }

import Cocoa

class StatisticsView: NSView {
    private var values: [(legend: String, color: NSColor, ratio: Float)] = []
    
    func updateValues(values: [(legend: String, color: NSColor, ratio: Float)]) {
        self.values = values

            return nil
        }
    }

    override func viewDidMoveToWindow() {
        self.window?.becomeKeyWindow()
    }
    
    override func drawRect(dirtyRect: NSRect) {
        let cy = CGRectGetHeight(self.bounds) / 2
