如何操作Winforms图表 [英] How can I manipulate Winforms chart
问题描述
我的图表有问题:
如何调整或操纵y轴数字从我想要的地方开始?
How can I adjust or manipulate the y-axis numbers to start from where I want it?
其次,有没有办法(属性)可以帮助我显示这个图表友好?我们可以看到所有的x轴名称都不显示,也许是空格b / w的灰色和蓝色条?
Secondly, is there a way (properties) which may help me display this graph friendly? As we can see all x-axis name aren't displayed and maybe a space b/w grey and blue bars?
任何帮助如何显示图表友好
Any help to how to display charts friendly is welcome
推荐答案
您可以设置每个轴的 Interval
:
yourChart.ChartAreas[0].AxisY.Interval = 17;
您可以从任何偏移
:
yourChart.ChartAreas[0].AxisY.IntervalOffset = 11;
对于 X轴标签
..但基本上相同的选项也适用于此:
..but basically the same options apply here too:
yourChart.ChartAreas[0].AxisX.Interval = 1;
要控制列的宽度,请设置自定义属性 PixelPointWidth
但是添加一个空格是不可能的。
To control the widths of the columns you set their custom property PixelPointWidth
but adding a gap is not possible.
我发现的所有解决方案都是黑客,最好的一个是在真实数据系列之间添加一个虚拟系列
All solutions I found are hacks and the best one is to add a dummy Series
between the real data series:
chart1.Series[0]["PixelPointWidth"] = "33";
chart1.Series["gap"]["PixelPointWidth"] = "33";
chart1.Series[2]["PixelPointWidth"] = "33";
填写与 DataPoints
X值为0!
这篇关于如何操作Winforms图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!