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
 Real-Time Graphics Tools for .Net (VB and C#)
 Specifying Tick Marks in Graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bechbd

15 Posts

Posted - 31 Oct 2005 :  13:29:59  Show Profile  Reply with Quote
I am having a problem specifying the length between tick marks on the x axis of the graph. I initially set them to ChartObj.TIMEAXIS_5SECONDSECOND when I declare the xaxis. The problem is that when I display the graph the major tick marks are at 10 seconds. I had a similar problem to this with the normal graphing and it was due to autoscaling the x-axis. I tried setting the xaxis.ScrollScaleModeX=RT_NO_AUTOSCALE_X but when I do this the graph no longer scrolls across the screen once more than on screens worth of data is shown. How can I specify the major tick mark spacing and still have the screen scroll?

quinncurtis

1164 Posts

Posted - 31 Oct 2005 :  14:20:20  Show Profile  Reply with Quote
The axis objects to not have a ScrollScaleModeX property. Are you talking about a ScrollFrame object ?
Go to Top of Page

bechbd

15 Posts

Posted - 31 Oct 2005 :  14:23:42  Show Profile  Reply with Quote
Yes I'm sorry I mean the scrollframe object.
Go to Top of Page

quinncurtis

1164 Posts

Posted - 31 Oct 2005 :  14:37:57  Show Profile  Reply with Quote
In order to scroll the x-axis the ScrollFrame must auto-scale the related axes, using our own algorithms for the axis tick marks. If you want something other than the default values that we choose you must override the AxisTickMarkTimeBase property between the ScrollFrame's autoscale and the ChartView.UpdateDraw call.

First, turn off the ScrollFrame's AutoRescaleFrame property after you create it, as seen below.

scrollFrame = new RTScrollFrame(this, currentTemperature1, pTransform1, ChartObj.RT_FIXEDEXTENT_MOVINGSTART_AUTOSCROLL);
.
.
.
scrollFrame.AutoRecaleFrame = false;	
chartVu.AddChartObject(scrollFrame);	



Then, where you call the ChartView.UpdateDraw method, insert a call to
scrollFrame.RescaleFrame(), and explicity set the axis AxisTickMarkTimeBase property. Setting the AxisTickMarkTimeBase property MUST take place betweent the ScrollFrame.RescaleFrame call the the ChartView.UpdateDraw call.

private void timer2_Tick(object sender, System.EventArgs e)
{
	if (this.IsDesignMode) return;			
	scrollFrame.RescaleFrame();
	xaxis.AxisTickMarkTimeBase = ChartObj.TIMEAXIS_5SECONDSECOND;
	this.UpdateDraw();		
}

Go to Top of Page

bechbd

15 Posts

Posted - 31 Oct 2005 :  15:31:50  Show Profile  Reply with Quote
Thanks that worked beautifully.
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