Slicers have horizontal scrolling when resizing the screen


#1

Hi guys, I have a problem with the slicer, what happens is that when resizing the screen the columns do not fit the size of the container, rather a horizontal scroll is shown, checking in the Chartfactor studio application I could see that sizes are added already established, so my question is: Can I make my slicer responsive or is it not possible?

let myChart = myData.graph("Slicer")
	.set("columnsWidth", [ {"group":214}, {"count":88}])
	.execute();

#2

Hi Sam, did you try this config from the documentation?, it’s a configuration for the RDT, but the slicer are an RDT basically:

rdt.set('autoSizeColumns', true)

#3

Hi thanks for answering, and yes, I did try but that doesn’t work for me. I think it’s probably because it’s a static size and not a dynamic one, like percentages or something like that.


#4

Hi @sam , I think is very important to specify some additional things, such as what framework or library you are using, but in any case my suggestion is, first remove the specific size of your slicer columns and then you can use the next code to refresh the size of widget when resizing the screen:

window.addEventListener("resize", () => {
    window.cf.getVisualization("your-slicer-id").resize();
});

#5

@emoya, I did what you told me and that solves the problem, when I’m resizing the window the slicer refreshes the size of its columns.

thanks a lot :slightly_smiling_face: :man_technologist: