Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
To show the cell range as data labels in Microsoft Excel:
The sample code below accesses a chart series data labels and sets the DataLabels.getShowCellRange() property to true to select the Label Contains - Value From Cells option.
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "source_show_range.xlsx");
// Create workbook from the source Excel file
const workbook = new AsposeCells.Workbook(filePath);
// Access the first worksheet
const worksheet = workbook.getWorksheets().get(0);
// Access the chart inside the worksheet
const chart = worksheet.getCharts().get(0);
// Check the "Label Contains - Value From Cells"
const dataLabels = chart.getNSeries().get(0).getDataLabels();
dataLabels.setShowCellRange(true);
// Save the workbook
workbook.save(path.join(dataDir, "output_out.xlsx"));
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.