This project has moved. For the latest updates, please go here.

Help Setting Chart Y-Axis "Horizontal axis crosses" to "At maximum category"

Feb 17, 2015 at 3:06 AM
Hello, I am having some trouble with my X-Axis. I want my Y-Axis to display numbers starting with the lowest numbers at the top, which I have done using:
chart.XAxis.Orientation = OfficeOpenXml.Drawing.Chart.eAxisOrientation.MaxMin;
However, once I did that, it made the X-Axis move to the top of the chart. I want the X-Axis to be at the bottom of the chart. I can do this in Excel by right clicking on the Y-Axis, selecting "Format Axis", then under "Axis Options" I would set "Horizontal axis crosses" to "At maximum category".

The closest thing I can find to do this with EPPlus is this:
chart.YAxis.CrossesAt = chart.XAxis.MaxValue;
But this doesn't have the desired effect, the X-Axis appears to be near the bottom but still within the data of chart. Upon looking at the setting within Excel you can see that this command actually sets "Horizontal axis crosses" to "At category number" with the value set to the maximum value on that axis. As mentioned, what I really need is to set "Horizontal axis crosses" to "At maximum category".

Any ideas on how to achieve this?

Thanks in advance.