如何自定义列系列中的列宽? [英] How customize column width in column series?

查看:125
本文介绍了如何自定义列系列中的列宽?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以自定义条形图的列宽.

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

致谢

Franco

推荐答案

简短答案,是的,请参见,您应该能够自定义实时图表中的所有内容,默认情况下,MaxColumnWidth属性为35px,这意味着该栏将被限制为35 px,无论是否有更多可用空间,如果您更改此属性,则条形将会增长,mySeries.MaxColumnWidth = double.PositiveInfinity;

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:

但是,这有点复杂,只有在有足够的空间增长时,条形才会有更大的宽度,任何条形(ColumnSeries,RowSeries,StackedRow和StackedColumn)的宽度总是始终为1图表单位,这是因为您可以注意到图表的缩放比例,无论您给它指定什么值,下一张图表都会说明其工作原理:

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:

在两种情况下,您只能自定义最大值,而不能自定义最小尺寸,在两种情况下,列宽都由MaxColumnWidth属性设置上限,但是请注意,当有很多条形时,列宽必须小于35px正确显示.

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.

这篇关于如何自定义列系列中的列宽?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆