Mini Grafik Ekle
Contents
[
Hide
]
Mini grafik ekle
Mini grafik, verilerin görsel bir temsilini sağlayan bir çalışma sayfası hücresindeki küçük bir grafiktir. Mevsimsel artışlar veya düşüşler, ekonomik döngüler gibi bir dizi değerdeki eğilimleri göstermek veya maksimum ve minimum değerleri vurgulamak için mini grafikler kullanın. En büyük etki için mini grafiği verilerinin yanına konumlandırın. Üç tür Mini Grafik vardır: Çizgi, Sütun ve Yığılmış.
Aşağıdaki örnek kodlarla Aspose.Cells ile mini grafik oluşturmak basittir:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// Instantiating a Workbook object | |
Workbook book = new Workbook(); | |
Worksheet sheet = book.getWorksheets().get(0); | |
sheet.getCells().get("A1").putValue(5); | |
sheet.getCells().get("B1").putValue(2); | |
sheet.getCells().get("C1").putValue(1); | |
sheet.getCells().get("D1").putValue(3); | |
// Define the CellArea | |
CellArea ca = new CellArea(); | |
ca.StartColumn = 4; | |
ca.EndColumn = 4; | |
ca.StartRow = 0; | |
ca.EndRow = 0; | |
int idx = sheet.getSparklineGroupCollection().add(SparklineType.LINE, "!A1:D1", false, ca); | |
SparklineGroup group = sheet.getSparklineGroupCollection().get(idx); | |
group.getSparklineCollection().add("!A1:D1", 0, 4); | |
// Saving the Excel file | |
book.Save("output.xlsx"); |