.NET Framework Bookmark and Share   
 index > Chart Controls for .NET Framework > MOSS 2007 Blank Chart Image
 

MOSS 2007 Blank Chart Image

I've followed instructions posted on the web as well as here, such as http://mosshowto.blogspot.com/2008/11/chart-controls-net-framework-sharepoint.html, but I keep getting a blank [white] image. I'm using code as in the examples provided from Microsoft.

// Create new data series and set it's visual attributes

Series series = new Series("Spline");
series.ChartType =
SeriesChartType.Spline;

series.BorderWidth = 3;

series.ShadowOffset = 2;

// Populate new series with data

series.Points.AddY(67);

series.Points.AddY(57);

series.Points.AddY(83);

series.Points.AddY(23);

series.Points.AddY(70);

series.Points.AddY(60);

series.Points.AddY(90);

series.Points.AddY(20);

// Add series into the chart's series collection

chart1.Series.Add(series);

frog3
Problem solved. I was calling a method in Page_Load to do the heavy lifting. In that method I was not referencing the chart control properly, which had earlier led me to overwrite the instance by calling new Chart(). REMEBER THE "THIS" KEYWORD!
frog3
I'm using IIS 6 andhave .NET 3.5 SP1 installed. I can see the image on the filesystem and it is blank [white]. Sniffing the HTTP conversation I am receiving 200 back for /ChartImg.axd. This is the definition in my aspx.

<

asp:Chart ID="Chart1" runat="server" ImageStorageMode="UseHttpHandler">

<Series>

<asp:Series Name="Default"></asp:Series>

</Series>

<ChartAreas>

<asp:ChartArea Name="TestArea"></asp:ChartArea>

</ChartAreas>

</asp:Chart>

frog3

You need to attach the Series to the ChartArea:

	series.ChartArea = "TestArea"

Also, I don't think you need the "Default" Series in the aspx, since you're creating one in the code.

sipla
I've tried that before and it didn't work. I have it in now and it doesn't work.
frog3
And I've already set permissions on the filesystem to allow Users to modify. Currently I'm in as an administrator and still getting a blank chart.
frog3
Problem solved. I was calling a method in Page_Load to do the heavy lifting. In that method I was not referencing the chart control properly, which had earlier led me to overwrite the instance by calling new Chart(). REMEBER THE "THIS" KEYWORD!
frog3

You can use google to search for other answers

Custom Search

More Threads

• Connecting lines for supplemental pie chart?
• why Chart control not showing all points labels on x-axis
• using pie chart in gridview
• Printing
• How Can I get a series's color
• How to auto Fix XAxis
• asp.net Chart Controls on a user control in MVC
• Using MS Chart assemblies in ASP.NET Application without installation
• Custom Axis Labels
• Chart controls - text histogram