Is there a way to allow a Slate chart to scroll along the x axis?

300 Views Asked by At

I have a graph with an x-axis that has 53 categories, and the axis labels aren't showing up because they're too condensed.

Is there a way to make the chart scroll so all my categories will fit?

1

There are 1 best solutions below

0
On

If your chart axis is linear or time-series rather than categorical, you can turn on pan and zoom via the checkbox under the "Misc" menu. If your axis is categorical, make a container with scrolling enabled and put the chart inside the container. Then you can make the chart as wide as you'd like, and rely on the container's scrolling to allow you to see all the categories.

To get a bit fancier, you can use conditional CSS to dynamically resize the entire Chart within the scrolling container; this is useful if the number of categories is dynamic. Search your Foundry instance for scrollable bar chart to find a reference example.