Free Support Forum - aspose.com

Set legend.X combined with LegendPositionType.NotDocked

Hi Laurence,

i have still some trouble with my charts!

//Chart-Legende
chart.Legend.Position = LegendPositionType.NotDocked;
chart.Legend.X = Convert.ToInt32(cells.GetColumnWidth(0) * 30.5);
chart.Legend.Y = 100;
chart.Legend.Width = 400;
chart.Legend.Height = 20;

The width and height of the legend comes up correct but “chart.Legend.X” and “chart.Legend.Y” has no effect, the legend appears on top/left corner.

Am I usering wrong code or is this a bug?

Regards, Stefan

Hi Stefan,

You can try my sample in http://www.aspose.com/forums/ShowPost.aspx?PostID=5180.

Legend.X and Legend.Y has effect but it’s unit is not same as width/height. Its unit is 1/4000 of the chart area. So please set Legend.X and Legend.Y to 1000 and see what happens.