     }
 
     func updateActiveUserChart() {
+        guard !activeUserHistory.isEmpty else {
+            activeUserChartView.clear()
+            return
+        }
+
         let entries = activeUserHistory
             .map { ($0.0.timeIntervalSince1970, Double($0.1))}
             .map { ChartDataEntry(x: $0.0, y: $0.1) }

        activeUserCount = 0
        maxActiveUserCount = 0
        activeUserHistory.removeAll()
        let originDate = Date().addingTimeInterval(chartDuration * -1)
        for i in 0...Int(chartDuration / calculateActiveUserInterval) {
            let date = originDate.addingTimeInterval(calculateActiveUserInterval * Double(i))
            activeUserHistory.append((date, 0))
        }
        // updateActiveUserLabels()
        // updateActiveUserChart()
    }

    func updateActiveUserLabels() {
        activeUserValueLabel.stringValue = String(activeUserCount)
        maxActiveUserValueLabel.stringValue = String(maxActiveUserCount)
    }

    func updateActiveUser(active: Int) {
        activeUserCount = active
        maxActiveUserCount = max(maxActiveUserCount, active)
        if activeUserHistory.isEmpty {
            let originDate = Date().addingTimeInterval(chartDuration * -1)
            for i in 0...Int(chartDuration / calculateActiveUserInterval) {
                let date = originDate.addingTimeInterval(calculateActiveUserInterval * Double(i))
                activeUserHistory.append((date, 0))
            }
        }
        activeUserHistory.append((Date(), active))
        activeUserHistory = activeUserHistory.filter { Date().timeIntervalSince($0.0) < chartDuration }
    }
