Skip to content

Commit cd8aab0

Browse files
committed
Sample Added
1 parent acd7565 commit cd8aab0

5 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Solution>
2+
<Project Path="Chart Axis Manual Positioning/Chart Axis Manual Positioning.csproj" />
3+
</Solution>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Chart_Axis_Manual_Positioning</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.XlsIO.Net.Core" Version="*" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<None Update="Data\*">
17+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
18+
</None>
19+
<None Update="Output\*">
20+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
21+
</None>
22+
</ItemGroup>
23+
24+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using Syncfusion.XlsIO;
2+
3+
class Program
4+
{
5+
static void Main(string[] args)
6+
{
7+
using (ExcelEngine excelEngine = new ExcelEngine())
8+
{
9+
IWorkbook workbook = excelEngine.Excel.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx"));
10+
IWorksheet worksheet = workbook.Worksheets[0];
11+
12+
// Access the chart in the worksheet
13+
IChartShape chart = worksheet.Charts[0];
14+
15+
chart.PrimaryValueAxis.TitleArea.Layout.ManualLayout.Top = 0.15; // Adjust the vertical position of the title
16+
17+
18+
// Save the modified workbook
19+
workbook.SaveAs(Path.GetFullPath(@"Output/Output.xlsx"));
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)