I'm using Visual Studio 2010 to write a Winforms application in C#. I'm using the chart control from the regular toolbox to view data from my SQL database. As you see, the bar is very wide. Is there some property or way to make it smaller, and fixed?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I did a small example binding three values and set the PixelPointWidth
of 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";
will result in this chart
回答2:
You can use the following Code :
Chart1.Series["Series1"]["PixelPointWidth"] = "15";
Thank you.
回答3:
You can also set the PixelPointWidth
in the report designer as below.
- Click on the chart series, press
F4
to show the properties. - Change the
PixelPointWidth
inCustomAttributes
node.