我在 zedgraph 窗格中画了一条线,但有时会是这样:
虽然它应该是:
我从我的代码中找不到任何问题,任何人都知道如何解决这个问题,非常感谢!
这是我的代码的一部分:
MasterPane master = zdg_stock.MasterPane;
var stockValueList = new PointPairList();
for (int i = 0; i < _dtUserStockHistory.Rows.Count; i++)
{
XDate time = XDate.DateTimeToXLDate((DateTime)_dtUserStockHistory.Rows[i]["ush_time"]);
stockValueList.Add(
time,
double.Parse(_dtUserStockHistory.Rows[i]["stock_value"].ToString()));
}
var pValue = new GraphPane();
LineItem lValue = pValue.AddCurve(string.Empty, stockValueList, Color.Red);
master.Add(pValue);
using (Graphics g = zdg_stock.CreateGraphics())
{
master.SetLayout(g, PaneLayout.SingleColumn);
zdg_stock.AxisChange();
zdg_stock.IsSynchronizeXAxes = true;
zdg_stock.IsAutoScrollRange = true;
zdg_stock.IsShowHScrollBar = true;
zdg_stock.IsEnableVZoom = false;
zdg_stock.IsShowPointValues = true;
}
zdg_stock.AxisChange();