Beispiel #1
0
        /// <summary>
        /// 初始化轴线说明文字
        /// </summary>
        /// <param name="objGraphics"></param>
        private void SetAxisText(ref Graphics objGraphics)
        {
            float fltX = XYWidth - XSpace + XSlice / 2 - (XAxisText.Length - 1) * intFontSpace;
            float fltY = XYHeight - YSpace - intFontSpace;

            objGraphics.DrawString(XAxisText, new Font("宋体", FontSize), new SolidBrush(AxisTextColor), fltX, fltY);
            fltX = XSpace + 5;
            fltY = YSpace - YSlice / 2 - intFontSpace;
            objGraphics.DrawString(YAxisText.ToString(), new Font("宋体", FontSize), new SolidBrush(AxisTextColor), fltX, fltY);
            //for (int i = 0; i < YAxisText.Length; i++)
            //{
            //    objGraphics.DrawString(YAxisText[i].ToString(), new Font("宋体", FontSize), new SolidBrush(AxisTextColor), fltX, fltY);
            //    fltY += intFontSpace; //字体上下距离
            //}
        }
Beispiel #2
0
        /// <summary>
        /// 初始化轴线说明文字
        /// </summary>
        /// <param name="objGraphics"></param>
        private void SetAxisText(ref Graphics objGraphics)
        {
            try
            {
                float fltX = Width - XSpace - (XAxisText.Length - 1) * intFontSpace;
                float fltY = Height - YSpace - intFontSpace;
                objGraphics.DrawString(XAxisText, new Font("SimSun", FontSize), new SolidBrush(AxisTextColor), fltX, fltY);

                fltX = XSpace + 5;
                fltY = YSpace - YSlice / 2 - intFontSpace;
                objGraphics.DrawString(YAxisText.ToString(), new Font("SimSun", FontSize), new SolidBrush(AxisTextColor), fltX, fltY);
            }
            catch
            {
            }
        }