How customize column width in column series?

偶尔善良 提交于 2019-12-07 18:54:04

问题


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

Regards

Franco


回答1:


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:

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:

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

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.



来源:https://stackoverflow.com/questions/38731985/how-customize-column-width-in-column-series

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!