Date axis as Value axis with OpenXML

I'm trying to create a stacked bar chart in Excel where the value axis has dates. I need the distance between ticks to be 1 month (not 30 days, not 31 days: 1 month). I find that, while I can use the format unit option and date cells to show month and year in the value axis, the distance between ticks isn't 1 month and so the bars don't have the length they should, and I can't change that. The best I can do is setting the major and minor units to 30, so they get a distance of 30 days, but as I said, that screws up with the chart visualization.

Is there any way to create a Date axis as a Value axis?

Thanks.


.Axes(xlCategory).MajorUnit = 1 is for your 1 part of the axis, and .Axes(xlCategory).MajorUnitScale = xlMonths for Months

If you don't have the constants in open xml, then xlCategory = 1 , and xlMonths = 1

链接地址: http://www.djcxy.com/p/61038.html

上一篇: MSCharts最后一个轴标签隐藏

下一篇: 日期轴用OpenXML作为数值轴