!!!###!!!title=72-How to set column width in bar chart——VisActor/VChart FAQ documents!!!###!!!

How to set column width in bar chart?

Question Description

Because the amount of data is uncertain, when there is too little data, the columns of the histogram are too wide and do not conform to the design draft. How can I configure the column width to be narrowed? At the same time, when there is a lot of data, the column can maintain its original width.

Solution

VChart's column chart provides configuration items that can set the width of the column.

  • bandWidth directly sets the width of the column
  • barMinWidth The minimum width of the column
  • barMaxWidth The maximum width of the column

This requirement should be solved using barMaxWidth, just set it to the maximum width in the design draft.

Code Example

Quote