Hi Shweta,
You can control the bar
width using the
WidthPercent property:
NChart chart = nChartControl1.Charts[0];
NBarSeries bar = new NBarSeries();
bar.DataLabelStyle.Visible = false;
bar.BorderStyle.
Width = new NLength(0);
bar.EnableXPixelSnapping = false;
bar.
WidthPercent = 50;
chart.Series.Add(bar);
for (int i = 0; i < 1000; i++)
{
bar.Values.Add(i);
}
this will only work in the case the bar series is operating in categorical mode (e.g. you do not supply the xvalues). In case you provide xvalues you need to use Bar
WidthMode in combination
with LogicalBar
Width or Bar
Width depending on the mode:
NChart chart = nChartControl1.Charts[0];
NBarSeries bar = new NBarSeries();
bar.DataLabelStyle.Visible = false;
bar.BorderStyle.
Width = new NLength(0);
bar.EnableXPixelSnapping = false;
bar.UseXValues = true;
bar.Bar
WidthMode = Bar
WidthMode.Logical;
bar.LogicalBar
Width = 0.5f;
chart.Series.Add(bar);
for (int i = 0; i < 1000; i++)
{
bar.Values.Add(i);
bar.XValues.Add(i);
}
Note that in both cases we would advise you to disable x pixel snapping.
We hope this helps - let us know if you have any questions.
Best Regards,
Nevron Support Team