コード例 #1
0
        /// <summary>
        /// 设置X轴tick标记(时间格式字符串)
        /// </summary>
        /// <param name="xtickmarks">时间文本</param>
        /// <param name="Format">tick时间格式</param>
        public void SetXTickMark(string[] xtickmarks, string Format)
        {
            if (xtickmarks != null)
            {
                try
                {
                    string[] newmarks = new string[xtickmarks.Length];
                    xmarkFormat = Format;
                    xmarkFrom   = TickMarkFrom.Strings;
                    for (int i = 0; i < xtickmarks.Length; i++)
                    {
                        newmarks[i] = Convert.ToDateTime(xtickmarks[i]).ToString(XMarkFormat);
                    }
                    xTickMark = newmarks;

                    refreshXTickMark();
                }
                catch
                {
                    xmarkFormat = string.Empty;
                    xmarkFrom   = TickMarkFrom.None;
                    refreshXTickMark();
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// 设置X轴tick标记(时间戳)
        /// </summary>
        /// <param name="starttime">起始时间</param>
        /// <param name="xtimeStamps">时间戳(单位为秒)</param>
        /// <param name="Format">tick时间格式</param>
        public void SetXTickMark(DateTime starttime, long[] xtimeStamps, string Format)
        {
            if (xtimeStamps != null)
            {
                try
                {
                    string[] xtickmarks = new string[xtimeStamps.Length];
                    xmarkFormat = Format;
                    xmarkFrom   = TickMarkFrom.TimeStamp;
                    for (int i = 0; i < xtimeStamps.Length; i++)
                    {
                        xtickmarks[i] = TimeConverter.GetTime(xtimeStamps[i], starttime).ToString(XMarkFormat);
                    }
                    xTickMark = xtickmarks;

                    refreshXTickMark();
                }
                catch
                {
                    xmarkFormat = string.Empty;
                    xmarkFrom   = TickMarkFrom.None;
                    refreshXTickMark();
                }
            }
        }
コード例 #3
0
 public void SetRMark(string[] rtickmarks)
 {
     if (rtickmarks != null)
     {
         rMark     = rtickmarks;
         rmarkFrom = TickMarkFrom.Strings;
         refreshRMark();
     }
 }
コード例 #4
0
 public void SetXTickMark(string[] xtickmarks)
 {
     if (xtickmarks != null)
     {
         xTickMark = xtickmarks;
         xmarkFrom = TickMarkFrom.Strings;
         refreshXTickMark();
     }
 }
コード例 #5
0
 public void SetRMark(string[] rtickmarks, int interval)
 {
     if (rtickmarks != null)
     {
         rMark         = rtickmarks;
         rmarkFrom     = TickMarkFrom.Strings;
         RMarkInterval = interval;
         refreshRMark();
     }
 }