Fix bar width

Hi,

is it possible to set the width for a bar chart? If setting the canvas size width 1000px and have only one dataset, the column is huge. I’d like to have the chart fully visible and have the bar column taking only 50px for example. I’. using version 2.1.4

thanks

Author: Fantashit

1 thought on “Fix bar width

  1. We wanted to display scrollable horizontal bar charts that maintained the same width for the bars. That way when you had 40+ labels you wouldn’t end up with 1px wide bars that were impossible to read. Conversely, when you have 1 or 2 labels you don’t get giant bars.

    From a usability standpoint I really think that you should consider adding an option to set the max/min width of the bars.

    What I ended up doing to get around this was write another function that counts the number of labels that are coming in and then multiplies that by a set number. That number is then used to set the height of the canvas. This allows us to show a consistent bar size, no matter how many entries there are.

Comments are closed.