Dear,
I am creating a pptx presentation using aspose.slide version 7.1 that contains a column chart. I am setting the value axes text to vertical 270 alignment. By doing so i can observe a certain padding to the right of the plotting area, please find attached “chart padding.png” screenshot.
When manually editing the Vertical Axis and setting the text layout alignment to “Rotate all text 270” the left padding disappears. Please find attached “chart padding fixed.png” screenshot.
Bellow is the code I am using:
{
SlideEx sld = pres.Slides[0];
Aspose.Slides.Pptx.ChartEx chart = sld.Shapes.AddChart(ChartTypeEx.ClusteredColumn, 100, 100, 400, 400);
chart.ChartTitle.Text.Text = “Sample Title”;
chart.ChartTitle.Text.CenterText = true;
chart.ChartTitle.Height = 20;
chart.HasTitle = false;
chart.HasLegend = false;
chart.ValueAxis.IsVisible = false;
chart.ValueAxis.MajorGridLines.FillFormat.FillType = FillTypeEx.NoFill;
chart.CategoryAxis.MajorGridLines.Style = LineStyleEx.ThickBetweenThin;
ChartDataCellFactory fact = chart.ChartData.ChartDataCellFactory;
chart.ChartData.Series.Clear();
chart.ChartData.Categories.Clear();
chart.ChartData.Categories.Add(fact.GetCell(0, 1, 0, “01-02-2013”));
chart.ChartData.Categories.Add(fact.GetCell(0, 2, 0, “02-02-2013”));
chart.ChartData.Categories.Add(fact.GetCell(0, 3, 0, “03-02-2013”));
chart.ChartData.Categories.Add(fact.GetCell(0, 4, 0, “04-02-2013”));
chart.ChartData.Categories.Add(fact.GetCell(0, 5, 0, “05-02-2013”));
chart.ChartData.Categories.Add(fact.GetCell(0, 6, 0, “06-02-2013”));
int Id = chart.ChartData.Series.Add(fact.GetCell(0, 0, 1, “Series 1”), chart.Type);
ChartSeriesEx series = chart.ChartData.Series[Id];
series.Labels.ShowLeaderLines = true;
int defaultWorksheetIndex = 0;
series.Values.Add(fact.GetCell(defaultWorksheetIndex, 1, 1, 20));
series.Values.Add(fact.GetCell(defaultWorksheetIndex, 2, 1, 50));
series.Values.Add(fact.GetCell(defaultWorksheetIndex, 3, 1, 30));
series.Values.Add(fact.GetCell(defaultWorksheetIndex, 4, 1, 40));
series.Values.Add(fact.GetCell(defaultWorksheetIndex, 5, 1, 30));
series.Values.Add(fact.GetCell(defaultWorksheetIndex, 6, 1, 50));
TextFrameEx tf = chart.ValueAxis.TextProperties;
tf = chart.CategoryAxis.TextProperties;
tf.TextVerticalType = TextVerticalTypeEx.Vertical270;
}
Could you please share with me a code that allows me to set the value axes layout to “Vertical 270” without causing the Plot Area right padding.
Thank you in advance,
Sami Simon