Hi Patrice,
The Chart.Transparent cannot be used to output a transparent chart with respect to a Windows Form background, because .NET controls do not support alpha transparency at all. The .NET framework only supports single color transparency for a control, which means to specify one color to mean transparent. The code is (in C#):
........ create a chart as usual using white (or any normal color as the background color) ..........
//output chart as usual
Bitmap b = (Bitmap)c.makeImage();
//set white color to mean transparent
b.MakeTransparent(Chart.NTime(0xffffff));
winChartViewer1.Image = b;
Also, after making the chart image transparent, you still need to make the WinChartViewer control transparent. This is by setting the BackColor property of the WinChartViewer control to Transparent (in the property window).
Finally, please note that transparent in any .NET Windows forms means transparent relative to the Form background. It means you can see through the control to see the Form background. The .NET framework does not support making any Windows Form control transparent relative to another Windows Form control.
Hope this can help.
Regards
Peter Kwan |