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

FPHealthcare

22 Posts

Posted - 30 Jan 2006 :  20:26:15  Show Profile  Reply with Quote
How do you scale the chart (in fact the time coordinate transform) so that it's bigger than the actual data your plotting?
i.e. I'm trying to plot a graph with 5 days of data from 1st Jan to 5th Jan. When I use the 'Autoscale(dataset, ChartObj.AUTO_AXES_FAR, ChartObj.AUTO_AXES_FAR) it will scale it from 1st Jan to 5th Jan. What I'd like to be able to do is scale it so it's bigger - 31st Dec to 6th Jan for example, having 1 day either side. Essentially having a margin. Is this possible to do?

I know I can add and subtract dates from the dataset, then scale the transform manually, but is there an easier way to pad out the transform?

quinncurtis

1164 Posts

Posted - 31 Jan 2006 :  08:54:02  Show Profile  Reply with Quote
You can adjust the scale after the AutoScale call, as in the example below. It substracts 24 days from the starting time and adds 6 days to the ending time.

			
TimeSimpleDataset Dataset1 = new TimeSimpleDataset("Actual Sales",x1,y1);
TimeCoordinates pTransform1 = new TimeCoordinates();
pTransform1.AutoScale(Dataset1, ChartObj.AUTOAXES_FAR , ChartObj.AUTOAXES_FAR);
// Force start of y-scale to 0
pTransform1.SetScaleStartY(0);

// subtract 24 days from x-scale starting time
ChartCalendar start = pTransform1.GetTimeScaleStart();
start.Add(ChartObj.DAY_OF_YEAR, -24);
pTransform1.SetTimeScaleStart(start);

// add 6 days to x-scale ending time
ChartCalendar stop = pTransform1.GetTimeScaleStop();
stop.Add(ChartObj.DAY_OF_YEAR, 6);
pTransform1.SetTimeScaleStop(stop);
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