如何设置图表栏的宽度是多少?(How to set chart bar's width?)

2019-07-31 18:26发布

我使用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在报表设计如下。

  1. 点击图表系列,按F4以显示属性。
  2. 更改PixelPointWidthCustomAttributes节点。



文章来源: How to set chart bar's width?