Z ekseni

Olası Kullanım Senaryoları

Z ekseni olarak da bilinen bir derinlik (seri) eksenine sahip olan 3-B sütun, 3-B koni veya 3-B piramit gibi bazı 3-B grafikler için değiştirebilirsiniz. Çentik işaretleri, eksen etiketleri ve diğer işlemler arasındaki aralığı belirleyebilirsiniz.

Birincil ve İkinci Ekseni Microsoft Excel gibi kullanın

Lütfen yeni bir Excel dosyası oluşturan ve grafiğin değerlerini ilk çalışma sayfasına koyan aşağıdaki örnek koda bakın. Ardından bir grafik ekliyoruz ve grafik türünü Column3D olarak ayarlıyoruz, ardından Derinlik Ekseni olarak da adlandırılan Z Eksenini görebilirsiniz.

yapılacaklar:resim_alternatif_metin

Basit kod

// Create an instance of Workbook
Workbook workbook = new Workbook();
// Get the first worksheet
Worksheet worksheet = workbook.Worksheets[0];
// Put values to cells for creating chart
worksheet.Cells["A1"].PutValue("A");
worksheet.Cells["B1"].PutValue("B");
worksheet.Cells["C1"].PutValue("C");
worksheet.Cells["A2"].PutValue(2);
worksheet.Cells["A3"].PutValue(1);
worksheet.Cells["B2"].PutValue(2);
worksheet.Cells["B3"].PutValue(3);
worksheet.Cells["C2"].PutValue(2);
worksheet.Cells["C3"].PutValue(3);
// Add a chart to the worksheet
int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.Column3D, 9, 6, 25, 16);
// Access the instance of the newly added chart
Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex];
// Calculate the hart
chart.Calculate();
// Add SeriesCollection (chart data source) to the chart ranging from "A2" cell to "C3"
chart.SetChartDataRange("A2:C3", true);
// Hide the CategoryAxis axis
chart.CategoryAxis.IsVisible = false;
// Hide the ValueAxis axis
chart.ValueAxis.IsVisible = false;
// Save the file
workbook.Save("ZAxis.xlsx");
view raw ZAxis.cs hosted with ❤ by GitHub