Node.js ve C++ kullanarak Tick Label Yönünü Değiştir
Tick Etiketi Yönünü Değiştirme
Aspose.Cells, diyagram tik etiketi yönünü TickLabels.getDirectionType() özelliği kullanarak değiştirme imkanı sağlar. TickLabels.getDirectionType() özelliği, ChartTextDirectionType enumeration değerini kabul eder. ChartTextDirectionType enumeration aşağıdaki üyeleri sağlar:
- Yatay
- Dikey
- 90 Derece Döndür
- 270 Derece Döndür
- Yığınlanmış
Aşağıdaki görüntü kaynak ve çıktı dosyalarını karşılaştırır
Kaynak dosya görüntüsü
Çıktı dosyası görüntüsü
Aşağıdaki kod parçacığı, işaret etiket yönünü Rotate90’dan Yatay’a değiştirir.
Örnek Kod
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const sourceDir = path.join(__dirname, "data");
const outputDir = path.join(__dirname, "output");
const filePath = path.join(sourceDir, "SampleChangeTickLabelDirection.xlsx");
// Loads the workbook which contains hidden external links
const workbook = new AsposeCells.Workbook(filePath);
const worksheet = workbook.getWorksheets().get(0);
// Load the chart from source worksheet
const chart = worksheet.getCharts().get(0);
chart.getCategoryAxis().getTickLabels().setDirectionType(AsposeCells.ChartTextDirectionType.Horizontal);
// Output the file
workbook.save(path.join(outputDir, "outputChangeChartDataLableDirection.xlsx"));
Kaynak ve çıktı dosyaları aşağıdaki linklerden indirilebilir.