ZedGraph:如何在X轴(不是日期)中添加时间(usecs)

时间:2013-08-26 15:03:31

标签: c# time scale zedgraph

目前我的图表仅显示x轴的索引和y轴的当前值。 现在我在图形函数中添加了其他参数(NumberOfPoints = 1024,TimeImtervall = 0.0003s)。

我最终想要的是x轴显示时间值而不是索引。

但我发现了如何添加日期的唯一例子。

它与“XAxis.Type”和“XAxis.Scale.Format”有关,但我还没有发现如何做到这一点。

2 个答案:

答案 0 :(得分:0)

如果您想要日期/时间,我认为您需要使用XAxis.Type DateDateAsOrdinal。在这种情况下XAxis.Scale.Format应该有用,例如设为“HH:mm”。

http://zedgraph.sourceforge.net/documentation/default.html

答案 1 :(得分:0)

试试这个:

private void Form1_Load(object sender, EventArgs e)
    {
        GraphPane myPane = zedGraphControl1.GraphPane;

        myPane.XAxis.Title.Text = "Time(sec)";

        myPane.XAxis.Scale.Format ="f4";
        myPane.XAxis.Type = AxisType.Linear;

        myPane.XAxis.Scale.Min = 0;
        myPane.XAxis.Scale.Max = 0.3072;

        myPane.AxisChange();

        zedGraphControl1.Invalidate();
    }

您需要放大以查看milli&中的图表。 micro秒。

<强> Edit:

Customize the zedgraph scale format