Page 1 of 1
Discovering new axis start and end times using AxisArrow
Posted: Mon Oct 29, 2007 3:01 am
by 9787981
Hi
I've created an AxisArrow tool and associated it with my x-axis. The x-axis is time based. I've set the ScrollPercent on the AxisArrow to 10 percent. When I click on the left most arrow the start and end times of the x-axis are set back in time by 10% as expected. I need to be able to read the new start and end times that have been set on the x-axis so that I can feed these into a query that will be sent to our server to retrieve data between the new start and end times.
Is there a way I can read the x-axis start and end times, in order to achieve this functionality?
thanks,
Ben.
Posted: Tue Oct 30, 2007 9:03 am
by narcis
Hi Ben,
Yes, you can try using tChart1.Axes.Bottom.Minimum and tChart1.Axes.Bottom.Maximum.
Hope this helps!
Posted: Tue Oct 30, 2007 4:33 pm
by 9787981
... and these return doubles, so I'm using DateTime.FromOADate(...) to convert the double values to DateTime values - is this OK to do?
Also, I'm presuming this same mechanism will work for custom axes that are time based...
Narcís, is there a way to have the TeeChart time based axes automatically comply with the time format specified in the Regional Settings?
thanks,
Ben.
Posted: Wed Oct 31, 2007 10:16 am
by narcis
Hi Ben,
Yes, that's right.
Narcís, is there a way to have the TeeChart time based axes automatically comply with the time format specified in the Regional Settings?
You should set
tChart1.Axes.Bottom.Labels.DateTimeFormat to your machine's Regional Settings DateTime format, something like this:
Code: Select all
tChart1.Axes.Bottom.Labels.DateTimeFormat = Application.CurrentCulture.DateTimeFormat.ShortTimePattern;
Posted: Wed Oct 31, 2007 3:38 pm
by 9787981
Hey thanks Narcís!
It looks like I can logically OR ShortTimePattern and ShortDatePattern values, so that the labels are presented giving both the current DD/MM/YY and time information, so this works well.
Another prevalent problem I'd like to solve is one of displaying time labels at the first tick and last tick of the data presented. So for example right now, if I have my tick intervals at say 15 mins and the start point is at 12:46 and the end point is at 5:14, that first and last ticks are not labelled and it makes it diffucult to see where the actual start and end of data is, just by looking at the first and last labels. Do you have any recommendations on this issue?
thanks,
Ben.
Posted: Fri Nov 02, 2007 8:59 am
by narcis
Hi Ben,
The only solution I can think of is using custom labels as shown in
this thread.
Hope this helps!