Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How customize column width in column series?

I would like to know if is possible to customize the column width of a bar graph.

Regards

Franco

like image 496
FrancoTampieri Avatar asked Dec 19 '22 14:12

FrancoTampieri


1 Answers

Short answer, yes, see this, you should be able to customize everything in Live-Charts, by default MaxColumnWidth property is 35px, this means the bar will be capped at 35 px, no matter if there is more available space, if you change this property your bars will grow, mySeries.MaxColumnWidth = double.PositiveInfinity;

Playing with the column properties you can practically achieve any effect:

enter image description here

But it is a bit more complicated than that, bars will only have a greater width if there is enough space to grow, the width of any bar (ColumnSeries, RowSeries, StackedRow and StackedColumn), do always have a width of 1 chart unit, this because as you can notice the chart scales no matter what values you give to it, the next diagram explains a bit how it works:

enter image description here

For a bar series, the available space of a bar changes according to the number of visible bars:

enter image description here

You can only customize the max value, never the minimum dimension, in both previous cases the column width was capped by the MaxColumnWidth property, but notice when there are many bars, column's width needs to be less than 35px to be displayed correctly.

enter image description here

like image 101
bto.rdz Avatar answered Dec 29 '22 00:12

bto.rdz