SVG Formatında Görüntüye Grafik Dönüştürme

Contents
[ ]

Aşağıdaki örnek kod, bir grafiği SVG biçiminde bir imaja dönüştürmek için Aspose.Cells kullanımını açıklar. Kod, kaynak Excel dosyasını yükler ve ardından ilk çalışma sayfasındaki ilk grafiği SVG’ye kaydeder.

Aşağıdaki ekran görüntüsü, örnek kodla oluşturulan SVG biçimindeki dönüştürülmüş grafik imajını gösterir.

Çıktı görüntüsü

todo:image_alt_text

SVG’nin XML tabanlı bir biçim olması nedeniyle, çıktı grafik imajını Notepad gibi bir metin düzenleyicide açabilirsiniz, bu ekran görüntüsünde gösterildiği gibi.

Metin düzenleyicisindeki Çıktı SCG

todo:image_alt_text

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(ConvertCharttoImageinSVGFormat.class);
// Create workbook object from source Excel file
Workbook workbook = new Workbook(dataDir + "sample.xlsx");
// Access the first worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);
// Access the first chart inside the worksheet
Chart chart = worksheet.getCharts().get(0);
// Save the chart into image in SVG format
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.setImageType(ImageType.SVG);
chart.toImage(dataDir + "ChartImage.svg", options);