We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Set IDataLabel Width

Hi everyone :slight_smile:

is it possible to set the width of a IDataLabel?

grafik.png (37.9 KB)

This code unfortunately does not work:
IDataLabel lbl = series0.getDataPoints().get_Item®.getLabel();
lbl.setWidth(100);

Best regards,
Möbi

Presentation1.zip (47.4 KB)

@moebi089,

I have observed your comments. Can you please try sample code which i shared below with you and share complete sample code along with environment details if there is still an issue.

labl.getDataLabelFormat().setShowValue(true);

        labl.setX(0.1f);
        labl.setY(0.1f);
        labl.setWidth(0.2f);
        labl.setHeight(0.1f);

Thank you very much! It works great! :slight_smile:

@Adnan.Ahmad

I still have a little issue, perhaps you can help me again, please :slight_smile:

Saving the pptx as a pdf in the end, the DataLabels were not shown, only the percentage value:

grafik.png (41.6 KB)

Is there any other option to set, do I forget anything?

Many thanks in advance and best regards,
Möbi
examples.zip (578.7 KB)

@moebi089,

I have observed your comments. Can you please share sample project to reproduce issue so that we may further investigate to help you out.

yeah - of course (sorry for german error messages…)

	String dataDir = "W:/develop/custom/";

	com.aspose.slides.License license = new com.aspose.slides.License();
	license.setLicense(new java.io.FileInputStream("W:/develop/custom/license/Aspose.Slides.lic"));
	
	String pptxFile = "Result_1475_1038_Bereich PT-PT-2_de.pptx";
	
	Presentation pres = new Presentation(dataDir + pptxFile);

	String filename = "Result_1475_1038_Bereich PT-PT-2_de"  ;

	try {
		
		pres.save(dataDir + filename+".pptx", SaveFormat.Pptx);
		pres.save(dataDir + filename+".pdf", SaveFormat.Pdf);
		out.println ( dataDir + filename+".pptx"+"<br>" );
		out.println ( "<a href='"+dataDir + filename+".pptx"+"' target='_blank'>open</a><br>" );


	} catch (Exception e) {
		e.printStackTrace();
		out.println ( "<font color='red'><b>FEHLER beim Zugriff auf: " + dataDir + filename + "</b><br>Geöffnet?</font>" );
	}

@moebi089,

I have worked with source code and sample files shared by you using Aspose.Slides for Java 18.6 and unable to observe any issue. I have also shared my generated result with you for your kind reference. Please check attachment. Can you please share your environment details along with which version of Aspose.Slides you are using on your end so that we may further investigate to help you out.Result_1475_1038_Bereich PT-PT-2_de.pdf (51.3 KB)

hmmm - yesterday I used v18.1, but just downloaded today the latest jar (v18.6 - 28/06/2018 23:45:10)

still the same issue :frowning:

grafik.png (10.7 KB)

Do I need a new license.key?

@moebi089,

I have observed your comments. Can you please share environment details with us so that we may further investigate to help you out. I also like to inform that i am unable to observe any issue using Aspose.Slides latest version 18.6 in window 10 environment.