x轴滚动
Posted lvlaozf
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了x轴滚动相关的知识,希望对你有一定的参考价值。
#region 设置x轴滚动
XYDiagram diagram = (XYDiagram)chartRoomUserAnalysisHis.Diagram;
diagram.AxisX.VisualRange.Auto = false;
//屏幕显示个数
int VisualCount = dtSource.Rows.Count > 30 ? 30 : dtSource.Rows.Count;
XYDiagram diagram = (XYDiagram)chartRoomUserAnalysisHis.Diagram;
diagram.AxisX.VisualRange.Auto = false;
//屏幕显示个数
int VisualCount = dtSource.Rows.Count > 30 ? 30 : dtSource.Rows.Count;
//屏幕最小值
DateTime minTime = DateTime.Parse(dtSource.Rows[0]["GETTIME"].ToString());
//屏幕最大值
DateTime maxTime = DateTime.Parse(dtSource.Rows[VisualCount - 1]["GETTIME"].ToString());
diagram.AxisX.VisualRange.MinValue = minTime;
diagram.AxisX.VisualRange.MaxValue = maxTime;
DateTime minTime = DateTime.Parse(dtSource.Rows[0]["GETTIME"].ToString());
//屏幕最大值
DateTime maxTime = DateTime.Parse(dtSource.Rows[VisualCount - 1]["GETTIME"].ToString());
diagram.AxisX.VisualRange.MinValue = minTime;
diagram.AxisX.VisualRange.MaxValue = maxTime;
#endregion
#region 添加X轴滚动条
XYDiagram diagram = (XYDiagram)chartControl.Diagram;
//屏幕显示个数
int VisualCount = dtBackwaterTemper.Rows.Count > 30 ? 30 : dtBackwaterTemper.Rows.Count;
//屏幕最小值
string strMinValue = dtBackwaterTemper.Rows[0]["BUILDMETERNAME"].ToString();
//屏幕最大值
string strMaxValue = dtBackwaterTemper.Rows[VisualCount - 1]["BUILDMETERNAME"].ToString();
diagram.AxisX.VisualRange.MinValue = strMinValue;
diagram.AxisX.VisualRange.MaxValue = strMaxValue;
#endregion
XYDiagram diagram = (XYDiagram)chartControl.Diagram;
//屏幕显示个数
int VisualCount = dtBackwaterTemper.Rows.Count > 30 ? 30 : dtBackwaterTemper.Rows.Count;
//屏幕最小值
string strMinValue = dtBackwaterTemper.Rows[0]["BUILDMETERNAME"].ToString();
//屏幕最大值
string strMaxValue = dtBackwaterTemper.Rows[VisualCount - 1]["BUILDMETERNAME"].ToString();
diagram.AxisX.VisualRange.MinValue = strMinValue;
diagram.AxisX.VisualRange.MaxValue = strMaxValue;
#endregion
以上是关于x轴滚动的主要内容,如果未能解决你的问题,请参考以下文章