Hi Jebarson,
Please excuse us for the delayed response.
Generally it's quite easy to do this - the only thing that you need to know is the number of data points. The following code shows how to export bars roughly 15 pixels wide to the clipboard:
nChartControl1.Panels.Clear();
NCartesianChart chart = new NCartesianChart();
chart.Dock = DockStyle.Fill;
NLength margin = new NLength(10, NGraphicsUnit.Pixel);
chart.BoundsMode = BoundsMode.Stretch;
chart.Margins = new NMarginsL(margin, margin, margin, margin);
Random rand = new Random();
int dataPointCount = 20;
NBarSeries bar = new NBarSeries();
bar.DataLabelStyle.Visible = false;
for (int i = 0; i < dataPointCount; i++)
{
bar.Values.Add(rand.Next(100));
}
chart.Series.Add(bar);
nChartControl1.Panels.Add(chart);
int pixelPerBar = 15;
int distance = 5;
int width = dataPointCount * (pixelPerBar + distance) + 2 * (int)margin.Value;
bar.WidthPercent = (float)pixelPerBar * 100.0f / (float)(pixelPerBar + distance);
nChartControl1.ImageExporter.CopyToClipboard(new NSize(width, width), NResolution.ScreenResolution, new NBitmapImageFormat());
The general idea is to use docked and stretched chart - this way you have a chart that fills the whole control area minus some margins (set to 10px in the above code). The width of the bars is controlled trough the WidthPercent property in the case of a categorical bar chart. If you want to use scatter you need to set the BarWidth property.
Hope this helps - let me know if you meet any problems.
Best regards,
Bob