Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions FAQ/Chart/.NET/Remove Axis/Remove Axis.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Solution>
<Project Path="Remove Axis/Remove Axis.csproj" />
</Solution>
Binary file not shown.
Empty file.
32 changes: 32 additions & 0 deletions FAQ/Chart/.NET/Remove Axis/Remove Axis/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Syncfusion.XlsIO;

class Program
{
static void Main(string[] args)
{
// Create an instance of ExcelEngine
using (ExcelEngine excelEngine = new ExcelEngine())
{
IApplication application = excelEngine.Excel;

application.DefaultVersion = ExcelVersion.Xlsx;

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;

//Removing CategoryAxis.
chart.PrimaryCategoryAxis.Visible = false;

//Removing ValueAxix.
chart.PrimaryValueAxis.Visible = false;
// Save the workbook to a file
workbook.SaveAs(Path.GetFullPath(@"Output\Output.xlsx"));
}
}
}
24 changes: 24 additions & 0 deletions FAQ/Chart/.NET/Remove Axis/Remove Axis/Remove Axis.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Remove_Axis</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.XlsIO.Net.Core" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Data\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Output\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading