Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Cells provides you with the ability to change the chart tick label direction by using the TickLabels.GetDirectionType() property. The TickLabels.GetDirectionType() property accepts the ChartTextDirectionType enumeration value. The ChartTextDirectionType enumeration provides the following members:
The following image compares the source and output files:


The following code snippet changes the tick label direction from Rotate90 to Horizontal.
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C
// Source and output directories
U16String sourceDir(u"..\\Data\\01_SourceDirectory\\");
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
// Create workbook and load the sample Excel file
Workbook workbook(sourceDir + u"SampleChangeTickLabelDirection.xlsx");
// Obtain the first worksheet
Worksheet worksheet = workbook.GetWorksheets().Get(0);
// Load the chart from the source worksheet
Chart chart = worksheet.GetCharts().Get(0);
// Set the category axis tick labels direction to Horizontal
chart.GetCategoryAxis().GetTickLabels().SetDirectionType(ChartTextDirectionType::Horizontal);
// Output the modified workbook to a new file
workbook.Save(outDir + u"outputChangeChartDataLabelDirection.xlsx");
std::cout << "Chart tick label direction changed successfully!" << std::endl;
Aspose::Cells::Cleanup();
}
The source and output files can be downloaded from the following links.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.