We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Error & Performance Issue

Hi,


The issue’s status is fixed, so we have requested you to kindly try our latest version/fix v7.3.3.x and let us know your feedback.

Thank you.

Tried the same code as mentioned below with the latest version of Aspose.Cells v 7.3.3.1, but still it is taking same time while using the chart.calculate method. The same works fine in version 7.0.2.2


Code:

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using Aspose.Cells;
using Aspose.Cells.Charts;
using Aspose.Cells.Drawing;

namespace PerfomanceIssue {
class Program {
static void Main(string[] args) {
Workbook test = new Workbook(@“C:\bin\testbook1.xlsx”);
Worksheet wrktest = test.Worksheets["__testsheet"];

        <span style="color:green;">//Adding a new worksheet to the Workbook object</span>
        <span style="color:blue;">int</span> sheetIndex = test.Worksheets.Add(<span style="color:#2b91af;">SheetType</span>.Chart);

        <span style="color:green;">//Obtaining the reference of the newly added worksheet by passing its sheet index</span>
        <span style="color:#2b91af;">Worksheet</span> worksheet = test.Worksheets[sheetIndex];

        <span style="color:blue;">int</span> chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.<span style="color:#2b91af;">ChartType</span>.Line, 1, 1, 25, 30);

        <span style="color:green;">//Accessing the instance of the newly added chart</span>
        Aspose.Cells.Charts.<span style="color:#2b91af;">Chart</span> chart = worksheet.Charts[chartIndex];

        <span style="color:green;">//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"</span>
        chart.NSeries.Add(<span style="color:#a31515;">"__testsheet!B2:GH168"</span>, <span style="color:blue;">true</span>);

        chart.NSeries.CategoryData = <span style="color:#a31515;">"__testsheet!A1:A168"</span>;
        chart.NSeries.SecondCatergoryData = <span style="color:#a31515;">"__testsheet!A1:A168"</span>;

        <span style="color:green;">////Setting the chart type of 2nd NSeries to display as line chart</span>
        chart.NSeries[0].Name = <span style="color:#a31515;">"Area One"</span>;

        <span style="color:blue;">for</span> (<span style="color:blue;">int</span> i = 0; i < 50; i++) {
            chart.NSeries[i].Type = Aspose.Cells.Charts.<span style="color:#2b91af;">ChartType</span>.LineStacked;
            chart.NSeries[i].Line.Weight = <span style="color:#2b91af;">WeightType</span>.HairLine;
            <span style="color:#2b91af;">DataLabels</span> datalabels = chart.NSeries[i].DataLabels;
            datalabels.ShowValue = <span style="color:blue;">false</span>;
        }

        chart.NSeries[10].Name = <span style="color:#a31515;">"Area Two"</span>;
        chart.NSeries[10].Type = Aspose.Cells.Charts.<span style="color:#2b91af;">ChartType</span>.Line;
        chart.NSeries[10].PlotOnSecondAxis = <span style="color:blue;">true</span>;
        chart.NSeries[10].Line.IsVisible = <span style="color:blue;">true</span>;
        chart.SecondCategoryAxis.IsVisible = <span style="color:blue;">true</span>;

        <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">"Applying Formatting ..."</span>);
        <span style="color:green;">//Formatting chart area                    </span>

        chart.PlotArea.Area.BackgroundColor = <span style="color:#2b91af;">Color</span>.White;
        chart.ChartArea.Area.BackgroundColor = <span style="color:#2b91af;">Color</span>.White;
        chart.PlotArea.Area.ForegroundColor = <span style="color:#2b91af;">Color</span>.White;
        chart.ChartArea.Area.ForegroundColor = <span style="color:#2b91af;">Color</span>.White;
        chart.Name = <span style="color:#a31515;">"Sample Sheet"</span>;
        chart.Title.Text = <span style="color:#a31515;">"Sample Chart"</span>;
        chart.SizeWithWindow = <span style="color:blue;">true</span>;
        chart.ValueAxis.IsAutomaticMajorUnit = <span style="color:blue;">true</span>;
        chart.SecondValueAxis.IsAutomaticMajorUnit = <span style="color:blue;">true</span>;
        chart.SecondValueAxis.IsVisible = <span style="color:blue;">true</span>;
        chart.ValueAxis.IsAutomaticMaxValue = <span style="color:blue;">true</span>;
        chart.SecondValueAxis.IsAutomaticMaxValue = <span style="color:blue;">true</span>;


        chart.Calculate();

        <span style="color:green;">////Saving the Excel file</span>
        test.Save(<span style="color:#a31515;">@"c:\bin\test2.xlsx"</span>);
    }
}

}


Attached is the sample datasheet


Hi,


I am able to notice the issue, you are right as I have tested using your code with template file using Aspose.Cells for .NET v7.3.3.2 , I can see the performance issue (it takes more time than it should to render/calculate the chart). I have reopened your issue “CELLSNET-41082”. We will look into it soon.

Thank you.

Do you have an update on when the fix will be available for issue: CELLSNET-41082

Hi,


We are working over your issue and hopefully we can provide you a fix for your issue “CELLSNET-41082” within the next 2-3 days.

Sorry for any inconvenience caused!

Hi,

Thanks for using Aspose.Cells.

Please try the new fix. As the number of series is too large, the performance is still very good. But the speed increased five times in the new fix.

Please download and try this fix: Aspose.Cells for .NET v7.3.3.4 and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-41120) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,


Tried using the DLL version 7.3.3.4 and the performance still does not seems to improve…

Can you provide the fix for the same ASAP…

Hi,


Please download and try the our latest version/fix: Aspose.Cells for .NET v7.3.4.1
I have used the fix with your previous code and the performance is much better now.

Let us know your run results on how much time the process takes now using v7.3.4.1.

Thank you.

Tried with the latest version and there is no improvement. Compare running the same code with version 7.0.2.2 and you will notice considerable performance difference.

Hi,


We tested and there are certain improvements in the latest versions/fix that is for sure. It takes about 10 seconds to process Chart.calculate() on my normal configured machine.

Could you create a separate console application using v7.3.4.1, zip it and post it here. Also provide us how much time (in milliseconds or seconds) it takes to complete the process. We will check it soon.

Thank you.

Please find attached the latest code file alomg with the excel used and time taken with the new Dll. With 7.0.2.2 it only takes 5 seconds while with 7.3.4.1, it takes 26 mins.



Hi,

Thanks for your sample code, template file and screen shot.

I can notice the issue using your sample code (given below) with your new template file you provided in you previous post. It takes very long time to process it.

Sample code:

DateTime start = System.DateTime.Now;

Workbook test = new Workbook(@"e:\test2\Book1.xlsx");
Worksheet wrktest = test.Worksheets["__test"];

//Adding a new worksheet to the Workbook object
int sheetIndex = test.Worksheets.Add(SheetType.Chart);

//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = test.Worksheets[sheetIndex];

int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.Line, 1, 1, 25, 30);

//Accessing the instance of the newly added chart
Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex];

//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
chart.NSeries.Add("__test!B2:AS4449", true);

chart.NSeries.CategoryData = "__test!A2:A4449";
chart.NSeries.SecondCatergoryData = "__test!A2:A4449";

////Setting the chart type of 2nd NSeries to display as line chart
chart.NSeries[0].Name = "Area One";

for (int i = 0; i < 43; i++)
{
chart.NSeries[i].Type = Aspose.Cells.Charts.ChartType.LineStacked;
chart.NSeries[i].Line.Weight = WeightType.HairLine;
DataLabels datalabels = chart.NSeries[i].DataLabels;
//datalabels.Text = "®Ù";
datalabels.ShowValue = false;
}

chart.NSeries[10].Name = "Area Two";
chart.NSeries[10].Type = Aspose.Cells.Charts.ChartType.Line;
chart.NSeries[10].PlotOnSecondAxis = true;
chart.NSeries[10].Line.IsVisible = true;
chart.SecondCategoryAxis.IsVisible = true;

Console.WriteLine("Applying Formatting ...");
//Formatting chart area

chart.PlotArea.Area.BackgroundColor = Color.White;
chart.ChartArea.Area.BackgroundColor = Color.White;
chart.PlotArea.Area.ForegroundColor = Color.White;
chart.ChartArea.Area.ForegroundColor = Color.White;
chart.Name = "Sample Sheet";
chart.Title.Text = "Sample Chart";
chart.SizeWithWindow = true;
chart.ValueAxis.IsAutomaticMajorUnit = true;
chart.SecondValueAxis.IsAutomaticMajorUnit = true;
chart.SecondValueAxis.IsVisible = true;
chart.ValueAxis.IsAutomaticMaxValue = true;
chart.SecondValueAxis.IsAutomaticMaxValue = true;


chart.Calculate();

////Saving the Excel file
test.Save(@"e:\test2\Test.xlsx", SaveFormat.Xlsx);

DateTime end = System.DateTime.Now;

Debug.WriteLine("start time :" + start);
Debug.WriteLine("end time :" + end);
Debug.WriteLine("time taken :" + (end - start));

I have logged a separate ticket with an id: "CELLSNET-41228" for your issue. We will look into your issue soon.

Thank you.

Hi,

We have improved the performance for chart.Calculate() method.

Please download and try this fix: Aspose.Cells for .NET v7.3.4.3 and let us know your feedback.

The performance seems to have improved but still is is still not at par with the version 7.0.2.2 where it is taking the least time…

Hi,


I tested on a normal configured system, it takes about 60 seconds to do the task using your code, e.g

Sample code:

DateTime start = System.DateTime.Now;

Workbook test = new Workbook(@“e:\test2\Book1.xlsx”);
Worksheet wrktest = test.Worksheets["__test"];

//Adding a new worksheet to the Workbook object
int sheetIndex = test.Worksheets.Add(SheetType.Chart);

//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = test.Worksheets[sheetIndex];

int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.Line, 1, 1, 25, 30);

//Accessing the instance of the newly added chart
Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex];

//Adding NSeries (chart data source) to the chart ranging from “A1” cell to “B4”
chart.NSeries.Add("__test!B2:AS4449", true);

chart.NSeries.CategoryData = “__test!A2:A4449”;
chart.NSeries.SecondCatergoryData = “__test!A2:A4449”;

////Setting the chart type of 2nd NSeries to display as line chart
chart.NSeries[0].Name = “Area One”;

for (int i = 0; i < 43; i++)
{
chart.NSeries[i].Type = Aspose.Cells.Charts.ChartType.LineStacked;
chart.NSeries[i].Line.Weight = WeightType.HairLine;
DataLabels datalabels = chart.NSeries[i].DataLabels;
//datalabels.Text = “®Ù”;
datalabels.ShowValue = false;
}

chart.NSeries[10].Name = “Area Two”;
chart.NSeries[10].Type = Aspose.Cells.Charts.ChartType.Line;
chart.NSeries[10].PlotOnSecondAxis = true;
chart.NSeries[10].Line.IsVisible = true;
chart.SecondCategoryAxis.IsVisible = true;

Console.WriteLine(“Applying Formatting …”);
//Formatting chart area

chart.PlotArea.Area.BackgroundColor = Color.White;
chart.ChartArea.Area.BackgroundColor = Color.White;
chart.PlotArea.Area.ForegroundColor = Color.White;
chart.ChartArea.Area.ForegroundColor = Color.White;
chart.Name = “Sample Sheet”;
chart.Title.Text = “Sample Chart”;
chart.SizeWithWindow = true;
chart.ValueAxis.IsAutomaticMajorUnit = true;
chart.SecondValueAxis.IsAutomaticMajorUnit = true;
chart.SecondValueAxis.IsVisible = true;
chart.ValueAxis.IsAutomaticMaxValue = true;
chart.SecondValueAxis.IsAutomaticMaxValue = true;


chart.Calculate();

////Saving the Excel file
test.Save(@“e:\test2\Test.xlsx”, SaveFormat.Xlsx);

DateTime end = System.DateTime.Now;

Debug.WriteLine(“start time :” + start);
Debug.WriteLine(“end time :” + end);
Debug.WriteLine(“time taken :” + (end - start));

What is your time statistics, could give us. And, what is the time consumed by v7.0.2.x?

We will further check it out.

Thank you.

The issues you have found earlier (filed as CELLSNET-41082) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

With 7.0.2.2 took 19 sec. & 7.3.4.3 took 40 sec.

We are expecting the performance as in 7.0.2.2

Regards

Arihant



Hi Arihant,


Thanks for your feedback.

I have reopened your issue “CELLSNET-41082” again. I have asked the concerned developer to look into it (if possible) and check if we enhance it further. Once we have any update on it, we will let you know here.

Thank you.


Hi,

Thanks for your posting and using Aspose.Cells for Java.

Please try the new fix Aspose.Cells for .NET v7.3.5.2. The performance improve eighty percent. But that still is slower than 7.0.2.2.

In the latest version, we need to calculate the position for the points of series. In the template file that you posted, the speed is slow as the points are large in the chart.

If the new fix is still too slow for you, we may provide a new method that will recover to 7.0.2.2.