Upper left and lower right delta of a chart

Hi,
I’m trying to get the upper left and lower right offset of a chart from the upper left and lower right cells that it is sitting on respectively. Meaning, it would be an offset of 0,0 for upper left offset if the chart rested completely upon its top left cell, but would have an offset of pixels if it was only partially on the cell. I noticed that ChartShape has getUpperDeltaX(), getUpperDeltaY(), getLowerDeltaX(), and getLowerDeltaY() but the values of the Upper deltas are returning a value in the 100s, and the value of the Lower deltas are returning 0 each so I’m guessing that these functions aren’t what I want. The Javadoc isn’t very clear on what these function do, so could someone please explain what exactly these functions do, and also if there is a way to get the exact information that I’m looking for? Thank you!

Hi,


Well, you may make use of ChartShape's (chart.getChartObject()) methods e.g getUpperLeftColumn, getUpperLeftRow, getLowerRightColumn, getLowerRightRow, getUpperDeltaX/Y etc. The DeltaX is in unit of 1/1024 of the width of the column. DeltaY is in unit of 1/256 of the height of the row. The getLowerRightRow is used to set the lower row index; the getLowerDeltaY is used to set vertical offset from its lower row etc.
Please give them a try these methods for your needs with a template file having your chart in it, if you find any issue or discrepency, give us your sample code and template file here to show the issue, we will check it soon.



Thank you.

Thanks for the reply. So as a clarification, if deltaX() returns a value of 700, then that means that the offset from the edge of the cells is 700/1024 of the width of the cell, is that correct?

Also, is there an easy way then to retrieve or calculate what the pixel value would be instead of just the ratio (or points preferably, but pixels will work).

Hi,


Yes, your understanding is right. The method(s) are used for getting offset value in unit of pixel. Also, for getUpperDeltaX(), getUpperDeltaY(), getLowerDeltaX(), and getLowerDeltaY(), the corresponding unit of the API is ratio.
If you want to get pixels for UpperDeltaX/Y, you can use Left/Top property of Shape that gets the offset from top-left cell for the top-left border of shape, in the unit of pixels, the UpperDeltaX is the same offset not in pixels but in ratio.


Thank you.

Yes, that’s exactly what I was looking for! I was looking through the API and I couldn’t find an equivalent getBottom() or getRight() function (for the offset in pixels for the bottom-right cell). I take it that support doesn’t exist for that? If it doesn’t, would it be possible to add it? If so that would be great, but otherwise thanks for the great support.

Hi,


Well, I am afraid these functions (getBottom() and getRight() of Shape class) are not available at the moment to know details about the bottom-right corner in pixels. I have logged a ticket for it with an id: CELLSJAVA-40300. We will look into it soon.

Thank you.

Thank you!

Hi,

Thanks for considering Aspose.Cells.

You are welcome. We will figure out your issue and try to implement these functions as a New Feature if feasible.

Once this new feature will be available, we will let you know by posting here and since your thread is already attached with the logged issue, so you will also get automatic notification.

Hi,

Thanks for using Aspose.Cells for Java.

Please download and try this fix: Aspose.Cells for Java v7.3.1.2.

We have added new APIs getBottom()/getRight() for getting corresponding offset.

Excellent, thank you!

Hi,

Thanks for using Aspose.Cells for Java.

You are welcome.

Please let us know if you face any other issue relating to Aspose.Cells and related products, we will be happy to assist you further.

The issues you have found earlier (filed as CELLSJAVA-40300) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.