我使用Visual Studio 2010来写C#WinForms应用程序。 我使用的是从正规工具箱中的图表控件,查看从我的SQL数据库中的数据。 正如你看到的,酒吧是很宽的。 是否有某种属性或方法,使之更小,和固定的吗?
Answer 1:
我做了一个小例子结合三个值 ,并设置PixelPointWidth
dataPointCustomProperties的。
int[] liste = new int[] { 1, 2, 3 };//, 4, 5, 6, 7 };
chart1.Series["Series1"].Points.DataBind(liste, "sampleData", "count", "Tooltip=count");
// dataPointCustomProperties
chart1.Series["Series1"]["PixelPointWidth"] = "1";
将导致在该图表中
Answer 2:
您可以使用下面的代码:
Chart1.Series["Series1"]["PixelPointWidth"] = "15";
谢谢。
Answer 3:
您还可以设置PixelPointWidth
在报表设计如下。
- 点击图表系列,按
F4
以显示属性。 - 更改
PixelPointWidth
在CustomAttributes
节点。
文章来源: How to set chart bar's width?