I am using DotNetCharting version 4.2. I am trying to create a chart, save it to disk and return the path as a string. Here is a simplified version of my code thus far.
Chart aChart = new Chart(); aChart aChart.Title = "Some Title"; aChart aChart.ChartArea.Background = new Background(Color.White); aChart.TempDirectory = "C:\\temp\\" aChart.Width = chartWidth; aChart.Height = chartHeight; imageName = aChart.FileManager.SaveImage();
I got this from this dotnetCharting support page. It is very straightforward code.
Here is the problem: The code above actually DOES create an image in the appropriate directory. This is NOT a directory permissions issue. When I add my actual data to the aChart, it actually DOES add it and an image is created. However, the
SaveImage() method always throws an exception of "Failed to map the path '/'." The
SaveImage() method is supposed to return a String, however, it always returns "" and the exception is thrown.
More Info: I am doing this in a WCF Service. Is it possible that since it's in a service the dotNetCharting DLL is having trouble with some internal MapPath?