When saving the chart to the Response.OutputStream a 'Generic GDI+ error' occurs if you use the PNG format.
A simple workaround for this problem is saving the image to a memorystream and then writing the memorystream to the Response.OutputStream.
So this is not really a bug in the charting library but when the PNG format is specified (via BufferedImage( chartView, System.Drawing.Imaging.ImageFormat.Png )) it would be a nice feature that the SaveImage method of a BufferedImage saves the image to a memorystream internally automatically when the PNG format is set so nobody will run into this problem again when using this charting library.
Thanks for the information. That error is a well discussed problem with trying to stream a PNG format directly to the Page.Response stream in .Net program. Just google ".Net PNG OutputStream" for a list of references.
For those interested in the code for an actual workaround, the following code can be used to replace the response code in the Page_Load methods of our ASP.Net examples
// Put user code to initialize the page here ChartView chartVu = GetInitializeChart(keystring, imagewidth, imageheight); if (chartVu != null) { MemoryStream memstream = new MemoryStream(); BufferedImage chartimage = new BufferedImage(chartVu, ImageFormat.Png); Response.ContentType = "image/png"; chartimage.SaveImage(memstream); memstream.WriteTo(Response.OutputStream) ; }
We will take your advise and make this automatic for PNG files internal to our BufferedImage class.