/// <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(); } } }
/// <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(); } } }
public void SetRMark(string[] rtickmarks) { if (rtickmarks != null) { rMark = rtickmarks; rmarkFrom = TickMarkFrom.Strings; refreshRMark(); } }
public void SetXTickMark(string[] xtickmarks) { if (xtickmarks != null) { xTickMark = xtickmarks; xmarkFrom = TickMarkFrom.Strings; refreshXTickMark(); } }
public void SetRMark(string[] rtickmarks, int interval) { if (rtickmarks != null) { rMark = rtickmarks; rmarkFrom = TickMarkFrom.Strings; RMarkInterval = interval; refreshRMark(); } }