I have a dataset with many (thousands) of 'categories'. I want to show a row chart with the top 15 categories, but can't figure out how. Without any default 'filters', the row chart shows every single category on the chart, which looks bad. I only want to show the top 15 categories, but based on the current crossfilter filters. How can I do that using dc.js & crossfilter?
Currently, my dimension function looks like:
const myCategoriesDimension = crossFilterData.dimension(
(d) => {
return d.category;
} );
And my group function looks like:
const myGroup = myCategoriesDimension.group();
My row chart looks like:
categoriesChart
.width(1200)
.height(1200)
.dimension(myCategoriesDimension)
.group(myGroup)
.elasticX(true);