0

我无法将 zedgraph 拆分为多个部分,我希望能够监控我正在运行的会话,并认为我会尝试构建一个显示我的结果的程序,主要是在图表上的速度。从文本文件中读取结果,然后将其当前存储在 zedgraph 的 int 列表和 pointparlist 中。我希望能够将图表分成三个部分,前 15% 是跑步的热身部分,中间 (70%) 是主要跑步部分,最后第三部分是冷却部分 (15%) . 而不是在图表上绘制整个会话并手动尝试确定我的热身结束的位置等,我想知道是否可以在热身和中间之后放置一条垂直线。

我将不胜感激任何建议或帮助,我已经尝试了几天,但如果有意义的话,我无法将我的意图放在谷歌搜索上。

在将速度值绘制在图表上之前拆分存储速度值的 int 列表是否是一种更好的方法?我愿意就如何解决这个问题提出建议。再次感谢很多人。

4

1 回答 1

1

简单的方法是画两条垂直线,然后变成3段。这是代码:

PointPairList warmUpList = new PointPairList();
    LineItem warmUpCurve = new LineItem("warmUpCurve");
    PointPairList coolingDownList = new PointPairList();
    LineItem coolingDownCurve = new LineItem("coolingDownCurve");

    private void Form1_Load(object sender, EventArgs e)
    {
        // Create an instance of Graph Pane
        GraphPane myPane = zedGraphControl1.GraphPane;

        // x & y variables to store the axis values
        double xVal;
        double yVal;

        // Clear the previous values if any
        warmUpList.Clear();
        coolingDownList.Clear();

        myPane.Legend.IsVisible = false;

        // Create a list using the above x & y values
        warmUpList.Add(myPane.XAxis.Scale.Min + myPane.XAxis.Scale.MajorStep*1.5 , myPane.YAxis.Scale.Max);
        warmUpList.Add(myPane.XAxis.Scale.Min + myPane.XAxis.Scale.MajorStep * 1.5, myPane.YAxis.Scale.Min);

        coolingDownList.Add(myPane.XAxis.Scale.Max - myPane.XAxis.Scale.MajorStep * 1.5, myPane.YAxis.Scale.Max);
        coolingDownList.Add(myPane.XAxis.Scale.Max - myPane.XAxis.Scale.MajorStep * 1.5, myPane.YAxis.Scale.Min);

        // Add the curves
        warmUpCurve = myPane.AddCurve(" ", warmUpList, Color.Red, SymbolType.None);
        coolingDownCurve = myPane.AddCurve(" ", coolingDownList, Color.Red, SymbolType.None);

        TextObj WarmUpTextObj = new TextObj("Warm Up", myPane.XAxis.Scale.Min + myPane.XAxis.Scale.MajorStep, myPane.YAxis.Scale.Max - myPane.YAxis.Scale.MajorStep);
        TextObj RunningTextObj = new TextObj("Running Test", myPane.XAxis.Scale.Max/2, myPane.YAxis.Scale.Max - myPane.YAxis.Scale.MajorStep);
        TextObj CoolingDownTextObj = new TextObj("Cooling Down", myPane.XAxis.Scale.Max - myPane.XAxis.Scale.MajorStep, myPane.YAxis.Scale.Max - myPane.YAxis.Scale.MajorStep);

        myPane.GraphObjList.Add(WarmUpTextObj);
        myPane.GraphObjList.Add(RunningTextObj);
        myPane.GraphObjList.Add(CoolingDownTextObj);

        zedGraphControl1.Refresh();
    }

在此处输入图像描述

于 2013-05-13T11:40:19.693 回答