This project has moved and is read-only. For the latest updates, please go here.

Chart Axis Scaling

Oct 7, 2010 at 4:07 PM


I was trying to code up a chart with the max/min scaling on the axis specified. The following code was something I came up, but it didn't work. It corrupted the spreadsheet. Did I miss something?


const string _scalingPos = "c:scaling/c:min/@val";

        public int Scaling




                return GetXmlNodeInt(_scalingPos);




                SetXmlNodeString(_scalingPos, value.ToString());



Oct 10, 2010 at 3:43 AM


Have a look at the patch that is in "converter failed to save the file xlsx" and change Scaling to float.


Oct 10, 2010 at 12:04 PM

Hi James,

Thanks for the reply. 

I am afraid that the data type change doesn't help. When I tried to diff the raw Chart1.xml, I found that problem was due to an extra node added under <c:catAx>: 

<c:txPr> <a:bodyPr/> <a:lstStyle/> </c:txPr>.

This catAx has nothing to do with the scaling I was working on. That is located under valAx.

The whole node:
				<c:axId val="267621504"/>
					<c:orientation val="minMax"/>
				<c:delete val="1"/>
				<c:axPos val="b"/>
				<c:tickLblPos val="none"/>
				<c:crossAx val="267619712"/>
				<c:crosses val="autoZero"/>
				<c:auto val="1"/>
				<c:lblAlgn val="ctr"/>
				<c:lblOffset val="100"/>
After I removed the green part and packed it back to the xlsx file, it worked and the scaling was changed.