We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

"Chart positioning" clarifications


<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I am trying to understand how to accurately set the position of graph. Basically, my problem is to generate 3 bar-charts, displayed horizontally, with all axis aligned. (Please have a look at excelFile.xls, attached to see the result I am expecting).

To perform it, I found three objects that might use: (see chart_object.JPG)

- The ChartArea (which represents the whole chart)

- The PlotArea (which represents the bars and the axis)

- The PlotAreaWithoutTickLabels (which represents the bars without axis)

For some reason, I cannot access to the properties of the ChartArea, but it is not useful for this purpose.

Also, the PlotAreaWithoutTickLabels is read-only, and accessible (correctly) only after calling the method chart.Calculate(). (see http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/aspose.cells.charts.chart.plotareawithoutticklabels.html )

Each of these objects is type of ChartFrame. So I have the properties X, Y, Width and Height. According to the documentation:

- X and Y coordinate of the upper left corner in units of 1/4000 of the chart area. (see http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/aspose.cells.charts.chartframe.x.html )

- Width and Height are in points. (see http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/aspose.cells.charts.chartframe.width.html )

Then, I decided to open this Excel file with Aspose and try to understand on my exemple what should be the values for the PlotArea’s member (The sample is Program.cs, the output is output.JPG).

And at that point I really don’t understand these results:

- The height of the 2 first graph are 4000, but both have actually a different size in the file (so my assumption is that Height is actually in 1/4000 of the Chart Area too). In addition, X + Width = 4000

- The height of my last graph is smaller than the two other graphs (why only this one?)

- For the two first graphs, I was expecting that the width of the PlotAreaWithoutTicks would be the same, but not at all.

I guess there is something I haven’t understood, so please could you clarify these points?

Thanks a lot,



Thanks for the sample test code with screen shots and Excel file.

I think you have raised the same issue with queries. We have already logged with an id: CELLSNET-40125. We will get back to you soon.

Thank you.


The chart area is big enough as 4000 units for 2003 Excel. The value is dynamic, we need to calculate by the chart size. We created a test based on your codes. Please check the attached archive. Hope, it will help you to understand for your needs.

Thank you