Author |
Topic  |
|
FPHealthcare
22 Posts |
Posted - 18 Jul 2006 : 16:49:02
|
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
|
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;
|
 |
|
FPHealthcare
22 Posts |
Posted - 18 Jul 2006 : 17:38:01
|
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 |
 |
|
quinncurtis
1164 Posts |
Posted - 18 Jul 2006 : 18:01:25
|
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.
|
 |
|
FPHealthcare
22 Posts |
Posted - 18 Jul 2006 : 18:26:38
|
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 |
 |
|
quinncurtis
1164 Posts |
Posted - 18 Jul 2006 : 18:46:56
|
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. |
 |
|
FPHealthcare
22 Posts |
Posted - 18 Jul 2006 : 18:51:32
|
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! |
 |
|
quinncurtis
1164 Posts |
Posted - 18 Jul 2006 : 21:12:50
|
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. |
 |
|
|
Topic  |
|
|
|