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?
Click on any bar in the Bar Chart and right click on it, then select Format Data Series from the right-clicking menu. See screenshot: 2. In the popping up Format Data Series pane, move the Zoom bar of the Gap Width to the left side until the bar width meets your needs under the Series Options section.
Larger bars The solution for this is to click the Excel chart's X axis, right click and choose Format Axis. Select Axis Options and then click on Text Axis to select it. This changes the way the axis is plotted giving wider bars. You can then adjust the gap width if necessary to make them wider.
Right-click or control-click, and choose Format Data Series from the context menu. In the Format Data Series dialog box, select Options. Then change the Gap width. For wider bars, make the gap width smaller.
If the bars are too narrow, the numbers are truncated; to fix this, press Ctrl + Right on the keyboard to make the bars wider."
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
You can use the following Code :
Chart1.Series["Series1"]["PixelPointWidth"] = "15";
Thank you.
You can also set the PixelPointWidth
in the report designer as below.
F4
to show the properties.PixelPointWidth
in CustomAttributes
node.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With