Unplanned
Last Updated: 19 Nov 2024 16:27 by ADMIN
Tao
Created on: 21 Oct 2024 14:22
Category: SpreadProcessing
Type: Feature Request
2
SpreadProcessing: Add support for managing the axis step/unit in the worksheet chart

Currently, the chart is generated considering the format applied to the cells. Thus, when the decimal part is clipped, duplicated values may occur and the developer doesn't have the option to update it:

This is the code:

            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets.Add();

            List<string> categories = new List<string> { "New", "In Progress", "Ready for Test", "Done", "Declined" };
            worksheet.Cells[0, 0].SetValue("New");
            worksheet.Cells[0, 1].SetValue(1);
            worksheet.Cells[0, 2].SetValue(2.5);
            worksheet.Cells[1, 0].SetValue("In Progress");
            worksheet.Cells[1, 1].SetValue(2.8);
            worksheet.Cells[1, 2].SetValue(0);
            worksheet.Cells[2, 0].SetValue("Ready for Test");
            worksheet.Cells[2, 1].SetValue(2);
            worksheet.Cells[2, 2].SetValue(1);
            worksheet.Cells[3, 0].SetValue("Done");
            worksheet.Cells[3, 1].SetValue(1.4);
            worksheet.Cells[3, 2].SetValue(0);
            worksheet.Cells[4, 0].SetValue("Declined");
            worksheet.Cells[4, 1].SetValue(3);
            worksheet.Cells[4, 2].SetValue(0);

            

            FloatingChartShape chartShape = new FloatingChartShape(worksheet, new CellIndex(5, 5), new CellRange(0, 0, 4, 2),ChartType.Column)
            {
                Width = 400,
                Height = 250
            };

            worksheet.Charts.Add(chartShape);

            CellSelection cellSelection = worksheet.Cells[new CellIndex(0, 1), new CellIndex(4, 2)];
            CellValueFormat specialFormat = new CellValueFormat("0");
            cellSelection.SetFormat(specialFormat);

            string outputFilePath = "SampleFile.xlsx";

            Telerik.Windows.Documents.Spreadsheet.FormatProviders.IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();

            using (Stream output = new FileStream(outputFilePath, FileMode.Create))
            {
                formatProvider.Export(workbook, output);
            }
            Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });

The requires options are setting the major/minor units for the axis:

2 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 19 Nov 2024 16:27

Hello,

Thank you for your feedback regarding this feature request. As a company, we continually strive to improve our products and services based on customer input, and we are grateful for your engagement on this topic. 

I understand how this functionality is important to you, but as of today, there haven't been any new updates regarding this feature, and currently, its implementation is not on our foreseeable roadmap. That said I cannot provide you with any specifics or estimates because I wouldn't want to accidentally mislead you.  

We have a system that prioritizes the logged items in the Feedback Portal, and we are doing everything in our power to answer customer requests and needs as fast as possible. We do our best to resolve all tasks, but some receive less attention than others, which is why they can sometimes be delayed, just like this one. Once any item is resolved, we immediately update the public feedback page to notify our clients so as previously mentioned please make sure you have voted for and are subscribed to the task so you can be up to date with its progress. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

supportinformatique
Posted on: 19 Nov 2024 09:52
We use the SpreadProcessing library to export Kendo MVC charts to Excel. However, we find it unfortunate that it lacks the properties and methods required to produce an identical chart.