I am using WSS 3.0 and am trying to display a Chart object from the System.Web.UI.DataVisualization.Charting namespace in a custom Web Part. My Web Part was built in C# in Visual Studio 2008, and I am using WSP Builder to deploy. My ultimate goal is to show items from a List in the chart, but at the moment I am just making a simple chart with one series. My code works on an ASP.NET WebForm, but when I copy and paste the code to a custom Web Part, all I see is a rectangle with the red X.
Here is my code, though I think the problem is elsewhere:
Chart Chart1 = new Chart();
Chart1.ChartAreas.Add("ChartArea1");
Chart1.Series.Add("Series1");
for (int 1 = 0; i <= 50; i++)
Chart1.Series["Series1"].Points.AddXY(i, i*2);
this.Controls.Add(Chart1);