Dear,
Hi Sami Simon,
Hi Sami Simon,
PresentationEx pres = new PresentationEx();SlideEx slide = pres.Slides[0];ChartEx chart = slide.Shapes.AddChart(ChartTypeEx.ClusteredColumn, 50, 50, 500, 400);//set plot areachart.PlotArea.Height = 0.5f; // chart.Heigh * 0.5 = 400 * 0.5 = 200chart.PlotArea.Width = 0.5f; // Chart.Width * 0.5 = 500 * 0.5 = 250chart.PlotArea.X = 0.25f; // chart.X = 500 * 0.25 = 125chart.PlotArea.Y = 0.25f; // chart.Y = 400 * 0.25 = 100pres.Write(“D:\Aspose Data\result.pptx”);
The issues you have found earlier (filed as SLIDESNET-33803) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
Dear,
Hi Sami Simon,
public static void setChartPlotAreaHeight(){PresentationEx pres = new PresentationEx();{SlideEx sld = pres.Slides[0];Aspose.Slides.Pptx.ChartEx chart = sld.Shapes.AddChart(ChartTypeEx.Pie, 10, 60, 600, 400);ChartDataCellFactory fact = chart.ChartData.ChartDataCellFactory;chart.HasLegend = false;chart.ChartTitle.Text.Text = “”;chart.ChartData.Series.Clear();chart.ChartData.Categories.Clear();chart.PlotArea.Height = 0.25f; // chart.Heigh * 0.5 = 400 * 0.5 = 200chart.PlotArea.Width = 0.25f; // Chart.Width * 0.5 = 500 * 0.5 = 250//The range of X and Y values is given on scale of 0 to 1. 0 mean minimum height or width. 1 mean maximum height or width of chart.chart.PlotArea.X = 0.0f;// 1.0f; // chart.X = 500 * 0.25 = 125chart.PlotArea.Y = 1.0f; // chart.Y = 400 * 0.25 = 100chart.ChartData.Categories.Add(fact.GetCell(0, 0, 0, “C1”));chart.ChartData.Categories.Add(fact.GetCell(0, 1, 0, “C2”));chart.ChartData.Categories.Add(fact.GetCell(0, 2, 0, “C3”));chart.ChartData.Series.Add(fact.GetCell(0, 0, 1, “Series 1”), chart.Type);ChartSeriesEx series = chart.ChartData.Series[0];series.Values.Add(fact.GetCell(0, 0, 1, 24));series.Values.Add(fact.GetCell(0, 1, 1, 74));series.Values.Add(fact.GetCell(0, 2, 1, 25));}pres.Write(“D:\Aspose Data\PlotAreaHeight.pptx”);}