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

Chart Axis Scaling

Oct 7, 2010 at 3:07 PM

Hello

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?

Thanks


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

        public int Scaling

        {

            get

            {

                return GetXmlNodeInt(_scalingPos);

            }

            set

            {

                SetXmlNodeString(_scalingPos, value.ToString());

            }

        }


Oct 10, 2010 at 2:43 AM

Hi,

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

James

Oct 10, 2010 at 11:04 AM

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:catAx>
				<c:axId val="267621504"/>
				<c:scaling>
					<c:orientation val="minMax"/>
				</c:scaling>
				<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"/>
				<c:txPr>
					<a:bodyPr/>
					<a:lstStyle/>
				</c:txPr>
			</c:catAx>
After I removed the green part and packed it back to the xlsx file, it worked and the scaling was changed.