Page 1 of 1

relative time on x-axis

Posted: Tue Jan 19, 2016 8:45 am
by Igor
Hi,

in my application i use a monotonic time to record the values.
The monotonic time variable has the datatype "ulong".
Series_Points.png
Series_Points.png (24.08 KiB) Viewed 5862 times
In the screenshot you can see that the text is too long for the X axis and is therefore not displayed.
chart_current_with_ulong_value_not_visible.png
chart_current_with_ulong_value_not_visible.png (20.93 KiB) Viewed 5862 times
I would like to show a relativ time on x-axis regardless of the x-axis value.
E.g.: values on the X-axis: "100 ... 0" or in the other case in the other direction "0 ... 100"
chart_relative_time_from_right_to_left.png
chart_relative_time_from_right_to_left.png (21.9 KiB) Viewed 5862 times
thank you very much
Igor

Re: relative time on x-axis

Posted: Tue Jan 19, 2016 11:27 am
by ArctionPasi
Hi Igor,

I think the easiest approach is to use two X axes.

xAxis1:
- attach your series to this axis.
- set Visible = false for the xAxis1

xAxis2:
- Set Reversed = True.
- axis2.SetRange(0, xAxis1.Maximum - xAxis1.Minimum);

You zoom your view, remember to update the axis2 range.

When you are monitoring your data, the xAxis2 will be static, and the data flows as xAxis1 scrolls.

Something like this ;)

Re: relative time on x-axis

Posted: Wed Jan 20, 2016 2:49 pm
by Igor
thank you. Works fine for me :-)