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#)
 AxisMinorTicksPerMajor
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

carlao

54 Posts

Posted - 22 Mar 2006 :  23:12:09  Show Profile  Reply with Quote
I have a chart where the x axis is time. I know that CalcAutoAxis calculate the scale for a min/max value. But I would like to change the AxisMinorTicksPerMajor for x axis in some cases.
For example, CalcAutoAxis is doing the following
for range of 30 min I get Major Ticks of 10 min
for range of 60 min I get Major Ticks of 15 min
But when I have range of 120 min then I get Major Ticks of 60 min. In this case I would like to change major ticks to 30 min when range is 120 min.
I am using the code

ChartCalendar startdate = new ChartCalendar(date);
ChartCalendar stopdate = new ChartCalendar();

// set xstop date
stopdate = (ChartCalendar) startdate.Clone();
PTransform.SetTimeScaleStart(startdate);
PTransform.SetTimeScaleStop(stopdate);
XAxis.CalcAutoAxis();
UpdateDraw();

Any idea?
Thanks.

quinncurtis

1164 Posts

Posted - 23 Mar 2006 :  10:29:22  Show Profile  Reply with Quote
If you don't like the tick marks calculated by CalcAutoAxis, you can explicty set it for a time axis using the SetAxisTickMarkTimeBase methd or AxisTickMarkTimeBase property. All of the time axis tick mark time base constants are listed in the QCChart2D manual. It sounds like you want the TIMEAXIS_30MINUTEMINUTE tick mark time base.

// set xstop date

stopdate = (ChartCalendar) startdate.Clone();
PTransform.SetTimeScaleStart(startdate);
PTransform.SetTimeScaleStop(stopdate);
XAxis.CalcAutoAxis();
XAxis.SetAxisTickMarkTimeBase( TIMEAXIS_30MINUTEMINUTE );


You can't make it automatic with the CalcAutoAxis calculation though, unless you purchase our source code and make the change in the underlying DLL.
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