المحور Z

سيناريوهات الاستخدام المحتملة

بالنسبة لبعض الرسوم البيانية ثلاثية الأبعاد مثل العمود ثلاثي الأبعاد، والمخروط ثلاثي الأبعاد، أو الهرم ثلاثي الأبعاد الذي يحتوي على محور العمق (السلسلة)، المعروف أيضًا بمحور Z، يمكنك تغييره. يمكنك تحديد الفاصل بين علامات التدرج، وتسميات المحور وعمليات أخرى.

قم بالتعامل مع المحور الأساسي والثانوي على غرار Microsoft Excel

يرجى رؤية الكود العينة التالي الذي ينشئ ملف إكسل جديد ويضع قيم الرسم البياني في ورقة العمل الأولى. ثم نضيف رسمًا بيانيًا ونحدد نوع الرسم البياني ليكون عبارة عن عمود ثلاثي الأبعاد، ثم يمكنك رؤية المحور Z المسمى أيضًا بمحور العمق.

todo:image_alt_text

كود العينة التالي يولد ملف إكسل الناتج.

الكود المثالي

// Create an instance of Workbook
Workbook workbook = new Workbook();
// Get the first worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);
// Put values to cells for creating chart
worksheet.getCells().get("A1").putValue("A");
worksheet.getCells().get("B1").putValue("B");
worksheet.getCells().get("C1").putValue("C");
worksheet.getCells().get("A2").putValue(2);
worksheet.getCells().get("A3").putValue(1);
worksheet.getCells().get("B2").putValue(2);
worksheet.getCells().get("B3").putValue(3);
worksheet.getCells().get("C2").putValue(2);
worksheet.getCells().get("C3").putValue(3);
// Add a chart to the worksheet
int chartIndex = worksheet.getCharts().add(ChartType.COLUMN_3_D, 9, 6, 25, 16);
// Access the instance of the newly added chart
Chart chart = worksheet.getCharts().get(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.getCategoryAxis().setVisible(false);
// Hide the ValueAxis axis
chart.getValueAxis().setVisible(false);
// Save the file
workbook.save("ZAxis.xlsx");
view raw ZAxis.java hosted with ❤ by GitHub