繁体   English   中英

Zedgraph硬编码轴

[英]Zedgraph Hard code axis

tempTime = new DateTime(1989, 1, 1, Convert.ToInt32(tempTime.ToString("HH")) + 1, 0, 0);

string[] labels = new string[(totalMinutes / 60) + 3];
for (int a = 0; a < (totalMinutes / 60) + 3; a++)
{
    tempTime = tempTime.AddHours(1);
    labels[a] = tempTime.ToString("hh") + tempTime.ToString("tt");
}
//for (int i = 1; i < 20; i++)
//    labels[i] = "" + i * 2;
graph.XAxis.Type = AxisType.Text;
graph.XAxis.Scale.TextLabels = labels;

上面是我硬编码zed图x轴的代码,在我硬编码之前,这就是图形

http://i.stack.imgur.com/SNrm7.png

将代码应用到硬代码后,就会变成这样,请帮忙

    string XAxis_ScaleFormatEvent(GraphPane pane, Axis axis, double val, int index)
    {
        if (index == 0)
        {
            return "this is 0 index";
        }
        else
        {
            return "else this is not 0 index";
        }
    }

找到答案,我需要在图形中添加事件内部格式事件,由每个标签硬编码

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM