HischT
HischT

Reputation: 953

Position title Aspose slide chart

Is it possible to position the title of a Aspose powerpoint slide chart?

I have tried following:

chart.ChartTitle.X = 100;
chart.ChartTitle.Y = 100;

With different values but title is not moved.

Upvotes: 0

Views: 692

Answers (4)

Mudassir
Mudassir

Reputation: 433

Yes this is one of the alternates that you can use on your end.

Upvotes: 0

Mudassir
Mudassir

Reputation: 433

Yes, you are right. This is an alternate approach that you may try on your end to super impose an auto shape containing the chart title as overlay on the chart. However, in this approach you need to identify the appropriate position of auto shape over the chart to serve as title.

Upvotes: 0

HischT
HischT

Reputation: 953

Since it is not possible to move the chart title I simply created a title just above the chart using a regular autoshape, something like this:

IAutoShape autoshape = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 20, 0, 600, 50);
autoshape.UseBackgroundFill = true;
autoshape.LineFormat.FillFormat.FillType = FillType.NoFill;
autoshape.AddTextFrame(" ");
ITextFrame txtFrame = autoshape.TextFrame;
IParagraph para = txtFrame.Paragraphs[0];
IPortion portion = para.Portions[0];
portion.Text = title;
portion.PortionFormat.FillFormat.SolidFillColor.Color = Color.Black;
portion.PortionFormat.FillFormat.FillType = FillType.Solid;

Upvotes: 1

Mudassir
Mudassir

Reputation: 433

I have observed the code shared by you and it is Ok despite the values set for it. Inside the chart area the value is between 0-1. (0,0)(X,Y) being the bottom left and (1,1)(X,Y) being top right corner of chart. But still this feature is not working and there seems to be issue in API. You can contact Aspose.Slides support team over following link to log request for your issue.

http://www.aspose.com/community/forums/aspose.slides-product-family/109/showforum.aspx

Upvotes: 0

Related Questions