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

Free Support Forum - aspose.com

Dynamic Color legends with Name

Hi Team,
In my excel everything in dynamic but, currently we showing image for indexing color legends, but not we try to show dynamic legends at fixed index dynamically.

i try to create legends through rectangle share code like below , but its not supporting

Presentation pres = new Presentation();

		//Get the first slide
		ISlide sld = pres.getSlides().get_Item(0);
		 
		//Add autoshape of rectangle type
		IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 140, 150, 50);
		 
		//Set the fill color of the rectangle shape
		shp.getFillFormat().setFillType(FillType.Solid);
		shp.getFillFormat().getSolidFillColor().setColor (null);
		 
		//Apply some formatting on the line of the rectangle
		shp.getLineFormat().setStyle(LineStyle.ThickThin);
		shp.getLineFormat().setWidth(7);
		shp.getLineFormat().setDashStyle(LineDashStyle.Dash);
		 
		//set the color of the line of rectangle
		shp.getLineFormat().getFillFormat().setFillType(FillType.Solid);
		shp.getLineFormat().getFillFormat().getSolidFillColor().setColor ( null);

Can you please help me out for create legends with dynamically color and name at fixed index like attached document.

Thank you
Javeed Ali Khan A
legends.PNG (20.4 KB)

@Javeed123,

I have observed your requirements and like to share the chart legends indexing color or filling is defined by respective chart series fill color. One may not have separate color for chart series fill color and legend. You need to set the fill color for chart series and that will be applied for legend as well. Please check the attached presentation generated using PowerPoint for your convenience as well.

Presentation1.zip (51.0 KB)