Setting MajorGridLines.FormattingType to None sets IsVisible to false

Hi,


This might sound like it is expected behaviour but it should not be.

If you have a chart with a value axis like such:

Axis axis = chart.ValueAxis;

you get the following when setting the FormattingType:

axis.MajorGridLines.IsVisible = true; // FormattingType set to Solid
axis.MajorGridLines.FormattingType = ChartLineFormattingType.None; // At this point IsVisible is set to false automatically

This might make sense at first but there is a difference between an invisible MajorGridLine and a visible MajorGridLine with FormattingType set to None.
For example, if the MajorGridLine is set to visible but FormattingType to None, then Excel will still show the MajorGridLine in the formatting list (as “Vertical (Value) Axis Major Gridlines”), whereas if it is set to invisible, then it does not show up in the list.

This also impacts the display of a chart of mine, although I have not been able to reproduce it in a simple chart for you to test yet.


To recap:
Setting FormattingType to None should not impact the IsVisible value and the resulting OpenXml code in the xlsx should look similar to this (at the moment it removes the whole majorGridlines element):

<c:majorGridlines>
<c:spPr>
<a:ln w=“9525”>
<a:noFill />
</a:ln>
</c:spPr>
</c:majorGridlines>


Best regards,


Hi John,

Thanks for your posting and using Aspose.Cells.

Please let us know the steps to reproduce this issue. Also let us know the sample code which we could run and replicate this issue at our end. Please also provide some screenshots highlighting your issue in detail. It will help us understand your issue precisely and we will be able to fix it.

Thanks for your cooperation.

Hi,


See as above to reproduce, here’s the rest of the setup code:

var workbook = new Workbook();

Worksheet chartSheet = workbook.Worksheets[workbook.Worksheets.Add(SheetType.Chart)];
Worksheet ws = workbook.Worksheets[0];

ws.Cells[“A1”].PutValue(“Products”);
ws.Cells[“B1”].PutValue(“Users”);
ws.Cells[“A2”].PutValue(“Aspose.Cells”);
ws.Cells[“B2”].PutValue(10000);
ws.Cells[“A3”].PutValue(“Aspose.Slides”);
ws.Cells[“B3”].PutValue(8000);
ws.Cells[“A4”].PutValue(“Aspose.Words”);
ws.Cells[“B4”].PutValue(12000);

Chart chart = chartSheet.Charts[chartSheet.Charts.Add(ChartType.Pie, 7, 0, 20, 6)];

var axis = chart.ValueAxis;

axis.MajorGridLines.IsVisible = true; // FormattingType set to Solid
axis.MajorGridLines.FormattingType = ChartLineFormattingType.None; // At this point IsVisible is set to false automatically


What that means is that in Excel the chart looks like this:
http://i.imgur.com/mT1n8H3.png

As you can see, it is missing the option to change the ‘Vertical (Value) Axis Major Gridlines’

What I want for it to happen is this:
http://i.imgur.com/I1tmvfp.png

Major Gridlines is selectable and the Line is set to ‘No Line’ (which should be equivalent to setting FormattingType to None?).

Maybe I am changing the wrong property?

Thanks.

Hi John,

Thanks for your explanation, screenshots and using Aspose.Cells.

We were able to replicate this issue after opening and saving the source Excel file which is attached with this post. We found Vertical (Value) Axis Major Gridlines is no more selectable after resaving the Workbook.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43273 - Vertical (Value) Axis Major Gridlines is no more selectable after resaving the Workbook

I have also attached the output Excel file and screenshot illustrating this issue for a reference.

C#

Workbook workbook = new Workbook(“source.xlsx”);

workbook.Save(“output.xlsx”);


Hi John,


Please try the latest version of Aspose.Cells for .NET 8.3.1.6 against the problem logged earlier as CELLSNET-43273, and let us know of your feedback.

Hi,


Thank you for the update!

I would like this thoroughly test this but my code is based on .Net 4+ and relies heavily on methods that are not present in the 2.0 build of Aspose.

Could you kindly provide me with the 3.5 build?

Thanks

Hi John,


Aspose.Cells for .NET 8.3.1.6 is an interim version that we provide in .NET Framework 2.0 version only. The changes/fixes from this release would be embedded in our next official release of Aspose.Cells for .NET v8.3.2 which is scheduled for publication in the next week or so.

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


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