Reputation: 3
I need to show 127 bars but ChartJs display only 6 labels and all bars. How to increase bar height and make it more readable? I can't set fixed height to canvas because the chart can draw 1, 10, or 150 bars, it depends on received data. Sandbox: https://codesandbox.io/s/damp-smoke-4myvw?file=/App.tsx
Upvotes: 0
Views: 69
Reputation: 389
A possible solution would be to add the height
prop to the chart:
const BAR_HEIGHT = 23;
export function App() {
return <Bar options={options} data={data} height={BAR_HEIGHT * data.labels.length} />;
}
Upvotes: 0