From 712837a637adebb216269072ed16af13b4e3eea9 Mon Sep 17 00:00:00 2001 From: VinothSF5015 Date: Thu, 7 May 2026 15:41:48 +0530 Subject: [PATCH 1/2] 1008514 - Content Added --- Document-Processing-toc.html | 3 + ...horizontal-and-vertical-axis-in-a-chart.md | 88 +++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 Document-Processing/Excel/Excel-Library/NET/faqs/how-to-remove-both-horizontal-and-vertical-axis-in-a-chart.md diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html index b262ea62d..f0b0b618e 100644 --- a/Document-Processing-toc.html +++ b/Document-Processing-toc.html @@ -6776,6 +6776,9 @@
  • How to merge cells preserving topleft value and format in XlsIO?
  • +
  • + How to remove both horizontal and vertical axis in a chart? +
  • diff --git a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-remove-both-horizontal-and-vertical-axis-in-a-chart.md b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-remove-both-horizontal-and-vertical-axis-in-a-chart.md new file mode 100644 index 000000000..c675f0127 --- /dev/null +++ b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-remove-both-horizontal-and-vertical-axis-in-a-chart.md @@ -0,0 +1,88 @@ +--- +title: How to remove both horizontal and vertical axis in a chart? | Syncfusion +description: Shows how to remove both the category (horizontal) and value (vertical) axes from a chart in Syncfusion XlsIO by setting their Visible properties to false. +platform: document-processing +control: XlsIO +documentation: UG +--- + +# How to remove both horizontal and vertical axis in a chart? + +You can remove both the category (horizontal) and value (vertical) axes from a chart by setting the `PrimaryCategoryAxis.Visible` and `PrimaryValueAxis.Visible` properties to `false`. + +The following examples show the cross-platform C#, Windows-specific C#, and VB.NET variants. + +{% tabs %} +{% highlight c# tabtitle="C# [Cross-platform]" %} +// Create an instance of ExcelEngine +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + // Open workbook and get worksheet and chart + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data\InputTemplate.xlsx")); + IWorksheet worksheet = workbook.Worksheets[0]; + IChartShape chart = worksheet.Charts[0]; + + // Removing legend + chart.HasLegend = false; + + // Remove horizontal (category) axis + chart.PrimaryCategoryAxis.Visible = false; + + // Remove vertical (value) axis + chart.PrimaryValueAxis.Visible = false; + + // Save the workbook to a file + workbook.SaveAs(Path.GetFullPath(@"Output\Output.xlsx")); +} +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + IWorkbook workbook = application.Workbooks.Open("InputTemplate.xlsx"); + IWorksheet worksheet = workbook.Worksheets[0]; + IChartShape chart = worksheet.Charts[0]; + + // Removing legend + chart.HasLegend = false; + + // Removing CategoryAxis + chart.PrimaryCategoryAxis.Visible = false; + + // Removing ValueAxis + chart.PrimaryValueAxis.Visible = false; + + workbook.SaveAs("Output.xlsx"); +} +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +Using excelEngine As New ExcelEngine() + Dim application As IApplication = excelEngine.Excel + application.DefaultVersion = ExcelVersion.Xlsx + + Dim workbook As IWorkbook = application.Workbooks.Open("InputTemplate.xlsx") + Dim worksheet As IWorksheet = workbook.Worksheets(0) + Dim chart As IChartShape = worksheet.Charts(0) + + ' Removing legend + chart.HasLegend = False + + ' Removing CategoryAxis (horizontal) + chart.PrimaryCategoryAxis.Visible = False + + ' Removing ValueAxis (vertical) + chart.PrimaryValueAxis.Visible = False + + workbook.SaveAs("Output.xlsx") +End Using +{% endhighlight %} +{% endtabs %} + +A complete working example in C# is present on this GitHub page. \ No newline at end of file From b653d37b08797c001dc7f6e9c9865dee5b9ab334 Mon Sep 17 00:00:00 2001 From: VinothSF5015 Date: Thu, 7 May 2026 16:00:54 +0530 Subject: [PATCH 2/2] Update title for chart axis removal documentation --- ...-to-remove-both-horizontal-and-vertical-axis-in-a-chart.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-remove-both-horizontal-and-vertical-axis-in-a-chart.md b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-remove-both-horizontal-and-vertical-axis-in-a-chart.md index c675f0127..4e40c03a2 100644 --- a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-remove-both-horizontal-and-vertical-axis-in-a-chart.md +++ b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-remove-both-horizontal-and-vertical-axis-in-a-chart.md @@ -1,5 +1,5 @@ --- -title: How to remove both horizontal and vertical axis in a chart? | Syncfusion +title: Remove horizontal and vertical axes in a chart | Syncfusion description: Shows how to remove both the category (horizontal) and value (vertical) axes from a chart in Syncfusion XlsIO by setting their Visible properties to false. platform: document-processing control: XlsIO @@ -85,4 +85,4 @@ End Using {% endhighlight %} {% endtabs %} -A complete working example in C# is present on this GitHub page. \ No newline at end of file +A complete working example in C# is present on this GitHub page.