Hi Hans,
You can control the filling of each bar using the FillStyles series of bar - for example:
NChart chart = nChartControl1.Charts[0];
NBarSeries bar = new NBarSeries();
bar.Values.Add(10);
bar.FillStyles[0] = new NColorFillStyle(Color.Red);
bar.Values.Add(20);
bar.FillStyles[1] = new NColorFillStyle(Color.Green);
bar.Values.Add(30);
bar.FillStyles[2] = new NColorFillStyle(Color.Blue);
chart.Series.Add(bar);
Creates three bars with different colors. An alternative approach to this chart will be to use bars with mapped image fill that is generated so that it represents the color stripes you want. For example:
NChart chart = nChartControl1.Charts[0];
NBarSeries bar = new NBarSeries();
bar.Values.Add(10);
chart.Series.Add(bar);
chart.SetPredefinedChartStyle(PredefinedChartStyle.HorizontalLeft);
chart.Axis(StandardAxis.PrimaryY).UpdateScale();
Bitmap bmp = new Bitmap(1, 1024, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
for (int i = 0; i < 1024; i++)
{
bmp.SetPixel(0, i, Color.FromArgb(i % 255, i % 255, i % 255));
}
NImageFillStyle imgFill = new NImageFillStyle(bmp);
imgFill.TextureMappingStyle.MapMode = MapMode.RelativeToObject;
imgFill.TextureMappingStyle.MapLayout = MapLayout.Stretched;
bar.FillStyle = imgFill;
Creates a bar series with four white to black stripes. Hope this helps - let us know if you have any questions or meet any problems.
Best Regards,
Nevron Support Team