-
this.zedGraphControl1.GraphPane.CurveList.Clear();
-
this.zedGraphControl1.GraphPane.GraphObjList.Clear();
-
this.zedGraphControl1.IsShowCursorValues = false;
-
this.zedGraphControl1.IsShowPointValues = true;//数据节点
-
//this.zedGraphControl1.GraphPane.Y2AxisList.Clear();
-
//this.zedGraphControl1.GraphPane.YAxisList.Clear();
-
this.zedGraphControl1.IsEnableHZoom = false;
-
this.zedGraphControl1.IsEnableVZoom = false;
-
this.zedGraphControl1.GraphPane.Title.Text = dtime.Month + "-" + dtime.Day + "至" + dtime.AddDays(1).Month + "-" + dtime.AddDays(1).Day + "整点水位预测";
-
//this.zedGraphControl1.GraphPane.XAxis.Type = ZedGraph.AxisType.DateAsOrdinal;
-
LineItem curve = this.zedGraphControl1.GraphPane.AddCurve("水位", null,listy, Color.Blue, SymbolType.None);
-
//显示数据
-
const double offset = 0.0;
-
this.zedGraphControl1.GraphPane.Chart.Fill = new Fill(Color.White, Color.FromArgb(255, Color.ForestGreen), 45.0F);
-
for (int i = 0; i < water_height.Length; i++)
-
{
-
// Get the pointpair
-
PointPair pt = curve.Points[i];
-
// Create a text label from the Y data value
-
TextObj text = new TextObj(pt.Y.ToString(), pt.X, pt.Y + offset, CoordType.AxisXYScale, AlignH.Center, AlignV.Bottom);
-
-
text.ZOrder = ZOrder.A_InFront;
-
// Hide the border and the fill
-
text.FontSpec.Border.IsVisible = false;
-
text.FontSpec.Fill.IsVisible = false;
-
text.FontSpec.Angle = 1; //字体倾斜度
-
text.FontSpec.Size = 13;
-
text.FontSpec.FontColor = Color.Red;
-
//myPane.GraphObjList.Add(text);
-
this.zedGraphControl1.GraphPane.GraphObjList.Add(text);
-
}
-
this.zedGraphControl1.GraphPane.XAxis.Scale.TextLabels = labels;
-
this.zedGraphControl1.GraphPane.XAxis.Type = AxisType.Text; //X轴类型
-
this.zedGraphControl1.AxisChange();
-
this.zedGraphControl1.Refresh();
阅读(4191) | 评论(0) | 转发(0) |