public function generateCustom($witness)
    {
        if (isset($this->custom[$witness->getSafeName()])) {
            return $this->custom[$witness->getSafeName()];
        }

        $history = CustomHistory::where('meta', $witness->getSafeName())->get()->groupBy(function($item) {
            return $item->created_at->format('Y-m-d');
        })->map(function ($row) {
            return round($row->filter(function($item) {
                return (! is_null($item->value));
            })->avg('value'), 2);
        });

        // Fill the array gaps - because the chart wont populate correctly without 0 values
        for($i=20; $i>=0; $i--) {
            $this->custom[$witness->getSafeName()]['day'][] = Carbon::now()->subDay($i)->format('d');

            if (isset($history[Carbon::now()->subDay($i)->format('Y-m-d')])) {
                $this->custom[$witness->getSafeName()]['count'][] = $history[Carbon::now()->subDay($i)->format('Y-m-d')];
            } else {
                $this->custom[$witness->getSafeName()]['count'][] = 0;
            }
        }

        return $this->custom[$witness->getSafeName()];
    }