select c.config ->> '$.colorScale.baseColorScheme' as baseScheme, c.config ->> '$.type' as type, count(*) as count
from charts c
where c.config ->> '$.hasChartTab' = true
group by c.config ->> '$.colorScale.baseColorScheme', c.config ->> '$.type'
order by count(*) desc