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

Free Support Forum - aspose.com

Incorrect reading scatter chart type and name range references

Hi,

In the example spreadsheet attached, I have a “normal” scatter chart with only markers but it is been read as ScatterConnectedByLinesWithDataMarker. I think it should just be ChartType.Scatter.

The scatter chart also uses scoped name ranges to refer to its data series. The name ranges are ‘Table!Sheet’!ValX and ‘Table!Sheet’!ValY but Aspose returns the name range references without quoting the worksheet name.

For example, running the following code on the attached example spreadsheet

static void Main(string[] args)
{
Workbook wkbk = new Workbook(@“spreadsheet.xlsx”);

foreach (Worksheet wks in wkbk.Worksheets)
{
foreach (Chart chart in wks.Charts)
{
Console.WriteLine("Chart type: " + chart.Type);
SeriesCollection dataSource = chart.NSeries;

Console.WriteLine("Category: " + dataSource.CategoryData);
foreach (Series series in dataSource)
{
Console.WriteLine("Series Name: " + series.Name);
Console.WriteLine("Series Values: " + series.Values);
}
}
}
}

results in the following output.

Chart type: ScatterConnectedByLinesWithDataMarker
Category: =Table!Sheet!ValX
Series Name: =‘Table!Sheet’!$A$1
Series Values: =Table!Sheet!ValY

Can you please have a look? Thanks.

Hi,


Thanks for the template file and sample code.

After an initial test, I observed the issue as you mentioned by using your template file with sample code. I found two issues here:
1) The chart is read as ScatterConnectedByLinesWithDataMarker whereas it should denote Scatter.
2) As the scatter chart uses scoped name ranges to refer to its data series. The name ranges are ‘Table!Sheet’!ValX and ‘Table!Sheet’!ValY but these are retrieved as without quoting the worksheet name.

We need to check check the first issue. Also we will evaluate if we could put ‘’ quotes around the worksheet name when retrieving the named ranges references for category data and its values.
e.g
Sample code:

static void Main(string[] args)
{
Workbook wkbk = new Workbook(@“spreadsheet.xlsx”);

foreach (Worksheet wks in wkbk.Worksheets)
{
foreach (Chart chart in wks.Charts)
{
Console.WriteLine("Chart type: " + chart.Type);
SeriesCollection dataSource = chart.NSeries;

Console.WriteLine("Category: " + dataSource.CategoryData);
foreach (Series series in dataSource)
{
Console.WriteLine("Series Name: " + series.Name);
Console.WriteLine("Series Values: " + series.Values);
}
}
}
}

I have logged a ticket with an id “CELLSNET-42934” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi,


Please try our latest version/fix: Aspose.Cells for .NET v8.2.0.2

We have fixed your issue now.

Let us know your feedback.

Thank you.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.