We want to customize the orientation of legend in stackbar chart. we are getting weird display of chart/legend.Stacked Bar Legend Issue - Copy.zip (475.8 KB)
Thank you for posting the query. Could you describe the issue in more detail, please?
We want to display legend something like attached screen shots.we want to display legend this way.PNG (30.9 KB)
as for long legend chart/legend look ugly
You can customize the position and size of the Plot Area and Legend as shown below:
var presentation = new Presentation("Stacked Bar Legend Issue.pptx"); var chart = presentation.Slides.Shapes.OfType<IChart>().First(); chart.Width = 900; chart.Height = 390; chart.PlotArea.X = 0f; chart.PlotArea.Y = 0f; chart.PlotArea.Width = 0.5f; chart.PlotArea.Height = 0.8f; chart.Legend.X = 0f; chart.Legend.Y = 0.84f; chart.Legend.Width = 1f; chart.Legend.Height = 0.15f;
Please note that values of X and Width are specified as fractions of the chart width, and Y and Height are specified as fractions of the chart height.
can I move out the legend to out of the chart section and provide custom x/y/height/width? and also above code is not working… there is no effect of apply this change. I am working on 19… versions
the above code you provided is working… thanks
The chart legend and plot area cannot be moved out of the chart area.