You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I've been trying to use ChartJS to render a pseudo-timeline using a horizontal bar chart. The intention is to render these charts on the back end using the node-canvas npm package. This shows the kind of chart that I currently have https://codepen.io/nikkorn/pen/KKEJvLv
The problem I have is that I will often have to render timelines with a large amount of categories, most of the time each category will only have a single bar, but in some cases they may have a large number of bars, and ChartJS seems to give each category an equal amount of the available horizontal space in the canvas.
I don't want to have to render massively tall charts just to cater for edge cases where a few categories may have more visible bars. I'm actually after something that scales a little better to fit to the bars shown, as shown in this mockup: I haven't had much luck digging through the documentation and I can't seem to find a plugin which does the trick.
I've also set an explicit bar thickness to make it easier to calculate a figure to use as the canvas height.
If anyone has a solution it would be greatly appreciated. Thanks
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I've been trying to use ChartJS to render a pseudo-timeline using a horizontal bar chart. The intention is to render these charts on the back end using the node-canvas npm package. This shows the kind of chart that I currently have https://codepen.io/nikkorn/pen/KKEJvLv
The problem I have is that I will often have to render timelines with a large amount of categories, most of the time each category will only have a single bar, but in some cases they may have a large number of bars, and ChartJS seems to give each category an equal amount of the available horizontal space in the canvas.
I don't want to have to render massively tall charts just to cater for edge cases where a few categories may have more visible bars. I'm actually after something that scales a little better to fit to the bars shown, as shown in this mockup:
I haven't had much luck digging through the documentation and I can't seem to find a plugin which does the trick.
I've also set an explicit bar thickness to make it easier to calculate a figure to use as the canvas height.
If anyone has a solution it would be greatly appreciated. Thanks
Beta Was this translation helpful? Give feedback.
All reactions