Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting sparklineGroups.MaxAxisType to eSparklineAxisMinMax.Group does not work #864

Closed
Chewieez opened this issue May 1, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Chewieez
Copy link

Chewieez commented May 1, 2023

I am using EPPlus 6.2.2 in .Net 6 and am seeing that when I set the sparklineGroups.MaxAxisType = eSparklineAxisMinMax.Group, that setting is not maintained when the excel file is opened in Excel. The setting is always set to "Automatic for each sparkline" or eSparklineAxisMinMax.Individual

I can recreate it with a simple worksheet as follows:

using var excel = new ExcelPackage();
            var worksheet = excel.Workbook.Worksheets.Add("Test");

            worksheet.Cells[1, 1].Value = 1100;
            worksheet.Cells[1, 2].Value = 2200;
            worksheet.Cells[1, 3].Value = 3300;
            worksheet.Cells[1, 4].Value = 4400;
            worksheet.Cells[2, 1].Value = 2000;
            worksheet.Cells[2, 2].Value = 1254;
            worksheet.Cells[2, 3].Value = 5423;
            worksheet.Cells[2, 4].Value = 1400;
            worksheet.Cells[3, 1].Value = 2343;
            worksheet.Cells[3, 2].Value = 2355;
            worksheet.Cells[3, 3].Value = 2121;
            worksheet.Cells[3, 4].Value = 1231;
            worksheet.Cells[4, 1].Value = 954;
            worksheet.Cells[4, 2].Value = 4323;
            worksheet.Cells[4, 3].Value = 1112;
            worksheet.Cells[4, 4].Value = 2211;

            var sparklineGroups = worksheet.SparklineGroups.Add(
                        eSparklineType.Line,
                        worksheet.Cells[1, 6, 4, 6],
                        worksheet.Cells[1, 1, 4, 4]
                    );

            sparklineGroups.MinAxisType = eSparklineAxisMinMax.Custom;
            sparklineGroups.ManualMin = 0;
            sparklineGroups.MaxAxisType = eSparklineAxisMinMax.Group;

            using var outputStream = new MemoryStream();

            excel.SaveAs(outputStream);

EPPlus_Sparkline_Group_MaxAxisType

Am I doing something wrong or is this a bug?

Thanks!

@JanKallman JanKallman self-assigned this May 2, 2023
@JanKallman JanKallman added the bug Something isn't working label May 2, 2023
@JanKallman
Copy link
Contributor

Thanks for reporting this. It's a bug. I will provide a fix shortly.

JanKallman added a commit that referenced this issue May 2, 2023
@JanKallman
Copy link
Contributor

Fixed in EPPlus 6.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants