Referring a chart title

Hi,


I am using aspose cells for java aspose-cells-2.5.4.18.

I have a chart which has a title. I want the chart title to be dynamic. It should refer a cell in the worksheet and whenever the value of the cell changes the title should update.

In MS excel 2007 it is possible manually. Here are the steps to create in MSexcel.

create a chart–>sh​ow the title–>cl​ick on the title --> type the refererenc​ed cell in the formula bar.

Attached a sample file which has this functionality.

thanks,

Pravat

Hi,

Thanks for your sample file.

I will look into soon and let you know.

Hi,

Please see the code below, it sets the cell A1 in first sheet to linked source of your chart title. So whatever, you will enter in A1, it will be reflected in chart’s title.

Please use the latest version:
Aspose.Cells for Java v7.0.1.6


Please see the output xlsx file and the screenshot.

Java


String filePath = “F:\Shak-Data-RW\Downloads\Performance.xlsx”;


//Instantiating a Workbook object

Workbook workbook = new Workbook(filePath);


//Obtaining the reference of the first worksheet

Worksheet worksheet = workbook.getWorksheets().get(0);


Chart chart = worksheet.getCharts().get(0);


chart.getTitle().setLinkedSource(“=Sheet1!$A$1”);


//Saving the Excel file

workbook.save(filePath + “.out.xlsx”);


Screenshot:

Thank you,

It does work with Aspose 7.0. But it does not work with the said version.

Can you provide a fix on aspose-cells-2.5.4.18 ?
I wrote my whole code using above version and I if I use 7.0, I am getting lot of errors in my project.

I don't want to screw up my code for this.

Thanks,

Pravat

Hi,

Please download and try the most recent of 2.5 versions: Aspose.Cells for Java v2.5.4.20 and see if works for you.

No, it does not work with Aspose.Cells for Java v2.5.4.20 as well. Can you please provide a fix for this in 2.5.



Hi,

I am afraid, we can’t provide you fix based on older versions.