如何操作的WinForms图表

如何操作的WinForms图表

本文介绍了如何操作的WinForms图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题我的拟合图:

I have a problem fitting my 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

推荐答案

您可以设定每个轴的间隔

yourChart.ChartAreas[0].AxisY.Interval = 17;

和你可以把它开始在任何偏移

And you can make it start at any Offset:

yourChart.ChartAreas[0].AxisY.IntervalOffset = 11;



对于 x轴标签它很难讲不知道你的代码..

As for the X-Axis Labels it is hard to tell without knowing your code..

..但基本上是相同的选项在这里也适用:

..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";



与相同数量的数据点的填充它为0的X值!

这篇关于如何操作的WinForms图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 22:03