Hi Team
Code is throwing exception while creating pichart , this is happening for certain inputs . Please help to resolve this issue.
MemoryStream mstreamPie = new MemoryStream();
chartPie.Save(mstreamPie, System.Drawing.Imaging.ImageFormat.Png)
Hi Team
Code is throwing exception while creating pichart , this is happening for certain inputs . Please help to resolve this issue.
MemoryStream mstreamPie = new MemoryStream();
chartPie.Save(mstreamPie, System.Drawing.Imaging.ImageFormat.Png)
Hi, @SubhadeepIMF ! Are you talking about Aspose.PDF?
Could you please share a more detailed example?
The name space that we are using below .
using Aspose.Pdf;
using Aspose.Chart;
using Aspose.Cells;
Find below the high-level code workflow and let us know if you need more information . We are getting the error for few inputs
Step 1:
Created Imf.TravelCsqAdminUI.Intranet.Pages.Common.GraphGeneration() object of type Common.GraphGeneration.
Common.GraphGeneration objGraphGeneration = new Imf.TravelCsqAdminUI.Intranet.Pages.Common.GraphGeneration();
Step 2:
Created an object for Chart
Chart chartPie = new Chart();
Step 3:
We have called GenerateAirlinePieChart by passing data table and assigned the result to chartPie
chartPie = objGraphGeneration.GenerateAirlinePieChart(dtNewReport, -1);
Step 4:
We have created an object for memorystream and called Save method by passing mstreamPie and Png format to save PieChart.
MemoryStream mstreamPie = new MemoryStream();
chartPie.Save(mstreamPie, System.Drawing.Imaging.ImageFormat.Png)
Step 5:
While calling save method we are getting “Parameter is not valid Exception”
It seems you are using an older (outdated) Aspose.Chart API, please confirm? Please note that Aspose.Chart was discontinued several years ago and is no longer supported. Instead, we recommend using Aspose.Cells APIs to create Microsoft Excel charts and render them as images. You can find example code and documentation for reference.
https://docs.aspose.com/cells/net/creating-pie-chart-with-leader-lines/
https://docs.aspose.com/cells/net/chart-to-image/