Aspose.Cells を使用して、グラフの凡例エントリの塗りつぶしのテキストをなしに設定します

Aspose.Cells を使用して、グラフの凡例エントリの塗りつぶしのテキストをなしに設定します

次のサンプル コードは、グラフの 2 番目の凡例エントリの塗りつぶしのテキストをなしに設定します。をダウンロードしてくださいサンプルエクセルファイルこのコードと出力エクセルファイル参照用にそれによって生成されます。

次のスクリーンショットは、このコードの効果を強調していますサンプルエクセルファイル.

todo:画像_代替_文章

// 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(Settextofchartlegend.class);
// Open the template file.
Workbook workbook = new Workbook(dataDir + "sample.xlsx");
// Access the first worksheet
Worksheet sheet = workbook.getWorksheets().get(0);
// Access the first chart inside the sheet
Chart chart = sheet.getCharts().get(0);
// Set text of second legend entry fill to none
chart.getLegend().getLegendEntries().get(1).setTextNoFill(true);
// Save the workbook in xlsx format
workbook.save(dataDir + "output.xlsx", SaveFormat.XLSX);