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 in X-axis
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ram

1 Posts

Posted - 02 Dec 2003 :  11:33:43  Show Profile  Reply with Quote
Is there an example that uses time on x-axis that falls between two dates. For example shift production tracking between 6.00 PM to 6.00 AM, X-axis would be time and y-axis would be weight in tons.

Thanks

quinncurtis

1164 Posts

Posted - 02 Dec 2003 :  16:12:15  Show Profile  Reply with Quote
You can modify starting time of the ScatterPoints.c chart in the ChartTabDemo example to produce a graph like the one you want. See the "// ***" lines. If you define the x-values to cross a day boundary, the auto-scale methods automatically take this into account

int numPoints = 20;
ChartCalendar []x1 = new ChartCalendar[numPoints];
double []y1 = new double[numPoints];
double []y2 = new double[numPoints];
int i;
double z;

ChartCalendar currentDate = new ChartCalendar();

// *** This is the only line that changes in the ScatterPoints example
// *** Set the starting time of 6:00:00 PM
ChartCalendar.SetTOD(currentDate,18,0,0);

// Define 20 points, equals 10 hours worth of data
for (i=0; i < numPoints; i++)
{
z = (double) i - 10.0;
x1[i] = (ChartCalendar) currentDate.Clone();
y2[i] =
.
.
.
currentDate.Add (ChartCalendar.MINUTE,30);
}

TimeSimpleDataset Dataset1 = new TimeSimpleDataset("First",x1,y1);
TimeSimpleDataset Dataset2 = new TimeSimpleDataset("Second",x1,y2);

TimeCoordinates pTransform1 = new TimeCoordinates(
ChartObj.TIME_SCALE, ChartObj.LINEAR_SCALE);
pTransform1.AutoScale(Dataset1, ChartObj.AUTOAXES_FAR,
ChartObj.AUTOAXES_FAR);

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