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 & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Custom Date/Time Axes Display
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

FPHealthcare

22 Posts

Posted - 18 Jul 2006 :  16:49:02  Show Profile  Reply with Quote
I need to modify the way the Date/Time axes is displayed in my charts. Currently I am displaying 30 days using TIMEAXIS_WEEKDAY, which is basically what I want. I understand that with a 7 day week (which is what I'm using) Sunday will be the first day, and will have the major tick and will have the date displayed. A 5 day week will have Monday as the first day.

1. Is it possible to have Monday as the first day of the week with the major tick and date displayed on the axis, while keeping it a 7 day week?

2. Is it possible to format the way the date is displayed automatically from the PC's locale?

Thanks

Edited by - FPHealthcare on 18 Jul 2006 16:57:35

quinncurtis

1164 Posts

Posted - 18 Jul 2006 :  17:16:31  Show Profile  Reply with Quote
1. We don't have the option of using a 7-day week, with Monday identified using the major tick mark.

2. You can change the date to any of our predefined formats using the TimeAxisLabel.AxisLabelsFormat property. A list of constants is listed in the manual.


TimeAxisLabels xAxisLab = new TimeAxisLabels(xAxis );
xAxisLab.AxisLabelsFormat = ChartObj.TIMEDATEFORMAT_DMY;
chartVu.AddChartObject(xAxisLab);


Or you can define your own format by setting the TimeAxisLabels.CustomTimeFormatString to a string that uses the System.DateTime.ToString(..) format.

xAxisLab.CustomTimeFormatString ="d/MM/yy";


There is no automatic formatting that takes into account the locale. We leave that to you.

3. You can rotate the labels using the TimeAxisLabels.TextRotation property.
xAxisLab.TextRotation = 90;
Go to Top of Page

FPHealthcare

22 Posts

Posted - 18 Jul 2006 :  17:38:01  Show Profile  Reply with Quote
Thanks for the quick reply. It has been helpful, and I can display the lables how I want. However, when vertical, there is enough room to display a lable on every day. I have tried setting for the DateTime axis tick marks to TIMEAXIS_DAY, however it still only shows a lable every week. Is it possible to have it display date lable for every day?

Thanks
Go to Top of Page

quinncurtis

1164 Posts

Posted - 18 Jul 2006 :  18:01:25  Show Profile  Reply with Quote
Our own test with the CalendarData.CalendarLinePlot example program shows that setting the TimeAxis.AxisTickmarkTimeBase property to TIMEAXIS_DAY will display one major tick mark for each day, no minor tick marks, and a label will appear for each day.


TimeAxis xAxis = new TimeAxis(pTransform1);
xAxis.AxisTickMarkTimeBase = ChartObj.TIMEAXIS_DAY;
chartVu.AddChartObject(xAxis);


TimeAxisLabels xAxisLab = new TimeAxisLabels(xAxis );
xAxisLab.TextRotation = 90;
xAxisLab.CustomTimeFormatString = "DD/MM/YY";
chartVu.AddChartObject(xAxisLab);


Make sure you are not overriding the AxisTickMarkTimeBase setting by calling the TimeAxis.CalcAutoAxis method at some later time.

Go to Top of Page

FPHealthcare

22 Posts

Posted - 18 Jul 2006 :  18:26:38  Show Profile  Reply with Quote
Thanks again for the quick reply.
I have changed my code slightly. I was using the TimeAxis constructor and passing ChartObj.TIMEAXIS_DAY, which didn't work.
I have used the code as you have given, and have some success. It now has one major tick mark for each day, no minor tick marks, as it should, which is good.
However it still dosen't display every day. I have 30 days which I'm displaying, and it displays every 3rd day (every 2nd day in some places), so I'm assuming it's a spacing issue. So I've changed the font size down to 4, and it shows on every 2nd day, and every day in some places. To the eye, there seems to be plenty of room to display every day. Is there a way to force it to display everyday?

Thanks
Go to Top of Page

quinncurtis

1164 Posts

Posted - 18 Jul 2006 :  18:46:56  Show Profile  Reply with Quote
Specifing the tick mark time base in the TimeAxis constructor had a bug identified in March 2006. It is fixed in the current verison of the software. You can download the current version using your original download link.

The axis labels bounding box check takes into account potential descenders in the label string, making the bounding box appear larger than it needs to be if descenders are not part of the label.

You can turn off the overlap check by setting

TimeAxisLabels.OverlapLabelMode property to OVERLAP_LABEL_DRAW.
Go to Top of Page

FPHealthcare

22 Posts

Posted - 18 Jul 2006 :  18:51:32  Show Profile  Reply with Quote
Thanks again.
I will download the lastest version.
I'm not sure what desenders are, but setting it to OVERLAP_LABEL_DRAW works perfectly.

Thanks. You have been great with your support!
Go to Top of Page

quinncurtis

1164 Posts

Posted - 18 Jul 2006 :  21:12:50  Show Profile  Reply with Quote
Descenders are the lower part of the g, j, p, q, y lower case letters, as the y in July, the g in August. If pure numeric dates are used, i.e. 7/18/06, you will not find descenders.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07