Is their a way to implement chart.HasAxis(axisType- axisGroup) method

hi,


I have a requirement to check if the chart has the given type of axis or not. is there a way to do this right now?

thanks

Hi Yashali,

Thanks for your posting and considering Aspose.Cells.

Kindly explain your requirement in more detail with some screenshots and sample Excel file containing your sample chart. You can create the sample Excel file manually using Microsoft Excel and attach it here.

It will help us look into your issue more closely and precisely and we will be able to let you know that if this feature is available or needs to be implemented in our future versions.

hi,


there is some part of code for scale calculation which i want to be accessible only to charts that have axes. for ex. i wouldnt want scale calculation to be done on a pie chart. so is there a way to find out if a chart has a particular type of axis. i want something similar to the Excel method get_HasAxis(axisType, axisGroup)

Thanks

Hi Yashali,

Thanks for your posting and considering Aspose.Cells.

As a workaround, you can now the chart type using Chart.Type method. Please see the following sample code and its console output. I have also attached the source Excel file used inside the code for your reference.

C#


string filePath = @“D:\Downloads\source.xlsx”;


//Create workbook instance from source file

Workbook workbook = new Workbook(filePath);


//Access the first worksheet

Worksheet worksheet = workbook.Worksheets[0];


//Access the first chart

Chart chart = worksheet.Charts[0];


//Print the chart type

Console.WriteLine(chart.Type);
Console Output:
Pie

hi,


i dont want to check for all chart types that dont have axes. Too inefficient. is there a way to find out if a given chart has a given type of axis like excel’s get_HasAxis() ??

thanks

Hi Yashali,

Thanks for your posting and considering Aspose.Cells.

Kindly provide some Excel file containing some sample Charts that do not have axis for example you can include Pie chart in it.

It will be helpful for the development team to add this as a New Feature by looking at your sample charts and they will implement it in next versions of Aspose.Cells.

Thanks for your cooperation.

Hi,


I have attached the sample file. I want to be able to do something similar to this

if(chart.HasAxis(chart.CategoryAxis))
{
//do something
}
else
{
//do something
}

Thanks

Hi Yashali,

Thanks for your explanation and considering Aspose.Cells.

We have logged a New Feature request in our database to support this method. We will look into it and see if it can be implemented in our next versions. Once, it is implemented or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43220 - Implementation of Chart.HasAxis(axisType, axisGroup) method

Hi,


Please try our latest version/fix: Aspose.Cells for .NET v8.3.1.1 (attached).
We have fixed your issue now.

We provide HasAxis(AxisType aixsType, bool
isPrimary) method to support your needs.

Let us know your feedback.

Thank you.

Hi,


Thanks for your quick response!

Hi,


Hopefully the latest fix would suit your needs well. Feel free to write back in case you have further comments or questions, we will be happy to assist you soon.

Thank you.

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


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