本文介绍了在ZedGraph更改轴类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有连续的心脏跳动的时间数据(单位为毫秒),我试图让他们的动态图。因此,对XAXIS我XDate变量增加了 .AddMilliseconds(heart_beat_time)和Y轴 heart_beat_time



当我使用 AxisType.Date 这是相当不错。我可以改变最小最高和其他相关的值,但是当我改变 AXISTYPE。 DateAsOrdinal 我看不到点,也没有标签。在一些调试已经出现了该Zedgraph做漆点和标签,但也有连续的间非常大的差距。



我如何控制 DateAsOrdinal 最小值,最大值,MajorStep等等?有一个答案 DateAsOrdinal XAXIS标签,但它不工作。对我来说



有我想,使其工作有两个原因:




  1. 序似乎​​快(因为我得到了近10万点)


  2. 通过 AxisType.Date 当我滚动图表自动它没有显示在蜱标签




我的代码:

  myPane.XAxis.Type = AxisType.DateAsOrdinal; 
myPane.XAxis.Scale.MajorStepAuto = FALSE;
myPane.XAxis.Scale.MinorStepAuto = FALSE;
myPane.XAxis.Scale.MajorUnit = DateUnit.Minute;
myPane.XAxis.Scale.MinorUnit = DateUnit.Minute;
myPane.XAxis.Scale.Format =HH:MM:SS;
myPane.XAxis.Scale.Min =最小值;
myPane.XAxis.Scale.Max =最大;
myPane.XAxis.Scale.MinorStep =轻微;
myPane.XAxis.Scale.MajorStep =专业;
myPane.XAxis.Scale.BaseTic =新XDate(1999,1,1,0,0,0,0);
myPane.YAxis.Scale.Min = min_rr;
myPane.YAxis.Scale.Max = max_rr;



其中,

  INT min_rr = 100; 
INT max_rr = 2500;
XDate最小=新XDate(1999,1,1,0,0,0,0);
XDate最大值=新XDate(1999年,1,1,1,0,0,0);
INT轻微= 5;
INT主要= 10;


解决方案

我有同样的问题(无图或标签上X轴),使用时 AxisType.DateAsOrdinal



我通过省略代码行解决了 myPane .XAxis.Scale.Min = ??? 最大值= ???
这给了我一个很好的图形无间隙。



不过,现在我与 MousePositionValues​​ 函数的问题在我的 MouseMoveEvent


I have a data of time of consecutive heart beats (in milliseconds) and I'm trying to make a dynamic chart of them. So on XAxis I have XDate variable increased by .AddMilliseconds(heart_beat_time) and on YAxis heart_beat_time.

When I use AxisType.Date it's pretty good. I can change Min, Max and other related values, but when I change to AxisType.DateAsOrdinal I can not see points nor labels. During some debugging it has showed up that Zedgraph does paint the points and labels, but there are very large gaps between consecutive ones.

How can I control DateAsOrdinal Min, Max, MajorStep and so on? There is an answer Format DateAsOrdinal xAxis labels in ZedGraph but it doesn't work for me.

There are two reasons I want to make it work:

  1. Ordinal seems to be faster (as I got nearly 100k points)

  2. With AxisType.Date when I scroll chart automatically it's not showing labels under ticks

My code:

myPane.XAxis.Type = AxisType.DateAsOrdinal;
myPane.XAxis.Scale.MajorStepAuto = false;
myPane.XAxis.Scale.MinorStepAuto = false;
myPane.XAxis.Scale.MajorUnit = DateUnit.Minute;
myPane.XAxis.Scale.MinorUnit = DateUnit.Minute;
myPane.XAxis.Scale.Format = "HH:mm:ss";
myPane.XAxis.Scale.Min = Min;
myPane.XAxis.Scale.Max = Max;
myPane.XAxis.Scale.MinorStep = minor;
myPane.XAxis.Scale.MajorStep = major;
myPane.XAxis.Scale.BaseTic = new XDate(1999, 1, 1, 0, 0, 0, 0);
myPane.YAxis.Scale.Min = min_rr;
myPane.YAxis.Scale.Max = max_rr;

where

int min_rr = 100;
int max_rr = 2500;
XDate Min = new XDate(1999, 1, 1, 0, 0, 0, 0);
XDate Max = new XDate(1999, 1, 1, 1, 0, 0, 0);
int minor = 5;
int major = 10;
解决方案

I have the same problem (no graph or labels on XAxis) when using AxisType.DateAsOrdinal.

I solved by omitting the code lines myPane.XAxis.Scale.Min=??? and Max=???.This gives me a nice graph without gaps.

However now I have problems with the MousePositionValues function in my MouseMoveEvent.

这篇关于在ZedGraph更改轴类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 19:00