I have a realtime chart that I am re-coding in WPF from Silverlight. When I did this in Silverlight, as I added points, the xaxis major stroke lines stayed fixed but the labels updated (the labels were timestamps). Is there any build in way to make the major axis lines slowly move across the screen as time progresses? I am currently using the NumericXAxis buy I could also use the CategoryDateTimeXAxis if that makes a difference.
Hello Mike,
I am just checking if you got this worked out, or you still require any assistance, or clarification on the matter.
If this is what you were looking for please verify the answer so it helps other users as well.
You can choose between using a CategoryDateTimeAxis that is meant for DateTime values, or use numeric values with NumericXAxis and format only the labels to be shown as DateTime values. Here is forum post of mine that shows both in a single sample project: http://es.infragistics.com/community/forums/t/70620.aspx . In regards to the calculations there shouldn’t be much to it, only the scale animation should be adjust to show the proper percentage of data. Please update me with a sample of yours that is going to be used, so we can continue working on the exactly same thing.
Looking forward to hearing from you.
Sorry, I was a little vague. Since my x axis will be time I would like the labels being displayed to be proper interval times such as 12:30:15, 12:30:30, 12:30:45. Right now you sample would take the current time and then show 20 seconds (my unit of time) and there would be 4 major axis lines. The lines would be something like 12:30:11, 12:30:16, 12:30:21, etc. I would prefer to have the axis labels display 12:30:10, 12:30:15, 12:30:20. Point being, not only do I need to calculate the position, scale and range of the axis to make it scroll but I also need to configure it so that the label for each major or minor axis line displays a time that is divisible by 5.
Does that make sense? I can try to create a screenshot if not.
Thanks,
Mike
Hi Mike,
You are right the values are between 0 and 1 and represent the position. The position actually represents the left border of the thumb. Since I wanted to keep the scroll to the rightmost and since the constant axis range changes were overriding the position I had to add to it a value that would go a little over 1, so this seemed easiest.
Regarding “If I wanted the major axis lines to always fall on specific intervals of time such as every 10 seconds, is that going to be a calculation nightmare?” I am really not sure you have in mind. Please explain this in more details and if possible with some screenshots. Also I’d like to point out that the sample always show the same amount of data between 20 units of measurement on the X axis.
Thanks Petar. This is pretty close to what I want to accomplish. I am a little confused though about the WindowPositionHorizontal property. I thought that was a value between 0 and 1. In your sample you just keep adding 0.1 to it every half second right? How exactly is that working? What does that number actually represent?
If I wanted the major axis lines to always fall on specific intervals of time such as every 10 seconds, is that going to be a calculation nightmare?