We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Pie chart legend repeating

Thread ID:

Created:

Updated:

Platform:

Replies:

149932 Dec 15,2019 10:22 AM UTC Jan 3,2020 03:09 PM UTC ASP.NET Core - EJ 2 5
loading
Tags: XlsIO
Fathimath Nazma Rasheed
Asked On December 15, 2019 10:22 AM UTC

I have done a pie chart in Excel using ExcelEngine and IChartShape. The legend of the pie chart is repeating.
Code:
            using (ExcelEngine excelEngine = new ExcelEngine())
            {
                IApplication application = excelEngine.Excel;
                application.DefaultVersion = ExcelVersion.Excel2013;
                IWorkbook workbook = application.Workbooks.Create(1);
                IWorksheet sheet = workbook.Worksheets[0];

                object[] yValues = new object[] { 2000, 1000, 1000 };
                object[] xValues = new object[] { "Total Income", "Expenses", "Profit" };

                //Adding series and values
                IChartShape chart = sheet.Charts.Add();
                //chart.Legend.IsVerticalLegend = false;
                //chart.Legend.Position = ExcelLegendPosition.Bottom;
                chart.HasLegend = false;
                IChartSerie serie = chart.Series.Add(ExcelChartType.Pie);

                //Enters the X and Y values directly
                serie.EnteredDirectlyValues = yValues;
                //serie.EnteredDirectlyCategoryLabels = xValues;

                application.DefaultVersion = ExcelVersion.Excel2013;
                application.XlsIORenderer = new XlsIORenderer();

                application.XlsIORenderer.ChartRenderingOptions.ImageFormat = ExportImageFormat.Png;
                MemoryStream stream = new MemoryStream();

                //Saving the chart as image
                chart.SaveAsImage(stream);

                stream.Position = 0;

                //Download the PDF document in the browser
                FileStreamResult fileStreamResult = new FileStreamResult(stream, "image/png");

                fileStreamResult.FileDownloadName = "Sample.png";

                return fileStreamResult;

            }


Attachment: New_folder_c0711df7.zip

Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On December 16, 2019 10:25 AM UTC

Hi Fathimath, 

Greetings from Syncfusion. 

We are unable to reproduce the reported Pie chart legend repeating issue. The sample which we have tried at our end with the code snippet shared by you, can be downloaded from the following link. 


Please look into the following video screenshot for further reference. 


Kindly modify the sample and share us the issue reproducing one which will be helpful for us to investigate further and provide prompt solution at the earliest. Also, please confirm the version of Syncfusion XlsIO you are using. 

Regards, 
Keerthi. 


Fathimath Nazma Rasheed
Replied On December 17, 2019 04:17 AM UTC

hello,

I was using version 17.3.0.34.
Issue is fixed after changing version to 17.3.0.26

Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On December 18, 2019 07:15 AM UTC

Hi Fathimath, 

Thanks for sharing the details. 

We are able to reproduce the reported Pie chart legend repeating issue in v17.3.0.34 and validating it currently. We will share the validation details on 20th December 2019. 

Regards, 
Keerthi. 


Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On December 20, 2019 04:12 PM UTC

Hi Fathimath, 

Thanks for the patience. 

We have confirmed the issue Chart legend is rendered twice in Chart to Image conversion and logged a defect report. We will provide the fix for this issue on 3rd January 2020. 

Regards, 
Keerthi. 


Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On January 3, 2020 03:09 PM UTC

Hi Fathimath, 

Thanks for your patience. 

We have fixed the issue Chart legend is rendered twice in Chart to Image conversion and generated custom assemblies in the version v17.3.0.34. The custom assemblies can be downloaded from following link. 


This fix will be included in our release version 17.4-SP1 which will be rolled out by end of January 2020.  

Regards,     
Keerthi. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon