Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net
 Real-Time Graphics Tools for .Net (VB and C#)
 auto-scale overrides my time format
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

smertrios

USA
3 Posts

Posted - 03 Nov 2014 :  19:00:30  Show Profile  Reply with Quote
I have an RT plot for which I format the time x-axis such:

xTimeAxis.AxisLabelsFormat = ChartObj.TIMEDATEFORMAT_12HM;

When first displayed, all is good and the x-axis labels have the desired format of "HH:mm". However, as soon as I turn on Y-axis auto-scale, the format is reset to the default, e.g "HH:mm:ss".

quinncurtis

1586 Posts

Posted - 04 Nov 2014 :  08:25:30  Show Profile  Reply with Quote
The auto-scale/auto-axis routines have to be able to change the format of the axis labels, because the change in range is unbounded and may vary from seconds to days. You cannot use the same format in all cases. Each time axis tick variant has a default time format. For your specific case, you can change the default formats to use ChartObj.TIMEDATEFORMAT_12HM where ever TIMEDATEFORMAT_24HMS would normally be chosen, using the code below for the x-axis labels:

xAxisLab = new TimeAxisLabels(xaxis);
xAxisLab.TextFont = axisFont;
chartVu.AddChartObject(xAxisLab);
for (int i = 0; i < TimeAxisLabels.TIMEAXIS_MINUTE; i++)
      if (xAxisLab.GetTimeBaseLabelFormats(i) == ChartObj.TIMEDATEFORMAT_24HMS)
          xAxisLab.SetTimeBaseLabelFormats(i, ChartObj.TIMEDATEFORMAT_12HM);
Go to Top of Page

smertrios

USA
3 Posts

Posted - 04 Nov 2014 :  13:51:58  Show Profile  Reply with Quote
thanks, I'll give it a try.

However, I'm only enabling the y-axis auto-scale:

rt1.Frame.ScrollScaleModeY = ChartObj.RT_AUTOSCALE_Y_MAX;

Therefore, I do no expect the range of my x-axis to be changing, nor its label format. correct?
Go to Top of Page

quinncurtis

1586 Posts

Posted - 04 Nov 2014 :  14:28:25  Show Profile  Reply with Quote
No, you are not correct. If you are using an RTScrollFrame, the x-axis is constantly auto-scaling, that is what controls the scrolling. So you must do what I describe, regardless of whether or not you use any of the y-axis auto-scale modes.
Go to Top of Page

smertrios

USA
3 Posts

Posted - 04 Nov 2014 :  14:44:00  Show Profile  Reply with Quote
ok yes, it makes sense in that the start/end time will be changed as the scrolling takes place. However, what I meant is that the time scale does not change. And as a result, I wouldn't expect my time format to be ignored; it's just counter intuitive.

fyi, I applied your fix and it works. thank you for the quick reply.

Go to Top of Page

quinncurtis

1586 Posts

Posted - 04 Nov 2014 :  15:00:07  Show Profile  Reply with Quote
There other RTScrollFrame x-axis scroll modes beside the fixed extent (range) mode. Also, it possible to change the extent (range) of the x-axis in the fixed extent mode. So regardless of which x-axis scrolling mode is used, the software always calls x-axis auto-scale and auto-formatting routines.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07